- Code: Select all
import lejos.nxt.*;
public class HelloWorld
{
static UltrasonicSensor us = new UltrasonicSensor(SensorPort.S4);
public static void main (String[] aArg)
throws Exception
{
for (int i = 0; i < 100; i++) {
LCD.drawString("count: " + new Integer(
us.getDistance()).toString(),3,4);
LCD.refresh();
Thread.sleep(1000);
}
}
}
I'm using the win32 leJOS NXJ version 0.2.0 software.
Any help would be greatly appreciated,
Brian Fisher
