import stamp.core.CPU; import stamp.core.ScaledTimer16; import stamp.core.Timer; import stamp.core.Uart; import stamp.peripheral.lcd.SerialLCD; //import stamp.peripheral.rtc.DS1302; public class SerialLCDTest { static boolean tick=true; public static void main () { Timer clock = new Timer(); ScaledTimer16 scaledTimer = new ScaledTimer16 (400, 100); for (int i = 0; i < 15; i++) { scaledTimer.mark(); for (clock.mark(); !clock.timeout(1000);) ; // wait for one second int ticks = scaledTimer.passedTicks(); int time = scaledTimer.passedTime(); System.out.print(ticks); System.out.print(" ticks. "); System.out.print(time); System.out.print(" ms. "); System.out.println(tick?"tick":"tock"); tick=!tick; } // end for //DS1302 ds1302 = new DS1302 (CPU.pin13, CPU.pin14, CPU.pin0); //System.out.println (ds1302.readTime(false)); System.out.println ("Starting the test..."); SerialLCD screen = new SerialLCD(new Uart(Uart.dirTransmit, CPU.pin15, Uart.dontInvert, Uart.speed2400, Uart.stop1)); screen.backLightOn(); screen.blinkOff(); screen.cursorOff(); screen.clearScr(); screen.moveTo(SerialLCD.LINE2, 3); screen.write("Wow! It's working!"); } }