import stamp.core.*; public class Testing2 { static Uart serialTx = new Uart(Uart.dirTransmit,CPU.pin15,Uart.dontInvert,Uart.speed2400,Uart.stop1); static Uart serialRx = new Uart(Uart.dirReceive,CPU.pin14,Uart.dontInvert,Uart.speed2400,Uart.stop1); static Timer time = new Timer(); public static void main() { int n=0,c; char block = 3; serialTx.sendString("!DC16"); serialTx.sendByte(block); serialTx.sendByte('V'); while (true) { if (serialRx.byteAvailable()) { c = serialRx.receiveByte(); System.out.print(c + " " + n + " "); n++; } } /* char step1 = 1; char step2 = 2; char step3 = 4; char step4 = 8; while (true) { serialTx.sendString("!DC16"); serialTx.sendByte(block); serialTx.sendByte('L'); serialTx.sendByte(step1); System.out.print("Step 1 "); time.mark(); while (!time.timeout(1000)); serialTx.sendString("!DC16"); serialTx.sendByte(block); serialTx.sendByte('L'); serialTx.sendByte(step2); System.out.print("Step 2 "); time.mark(); while (!time.timeout(1000)); serialTx.sendString("!DC16"); serialTx.sendByte(block); serialTx.sendByte('L'); serialTx.sendByte(step3); System.out.print("Step 3 "); time.mark(); while (!time.timeout(1000)); serialTx.sendString("!DC16"); serialTx.sendByte(block); serialTx.sendByte('L'); serialTx.sendByte(step4); System.out.print("Step 4 "); time.mark(); while (!time.timeout(1000)); } */ } }