- Code: Select all
package test;
import lejos.nxt.*;
import lejos.nxt.addon.IRSeekerV2;
public class Bewegung
{
public static IRSeekerV2.Mode AC;
static IRSeekerV2 seeker = new IRSeekerV2(SensorPort.S1, AC);
static UltrasonicSensor Sonic = new UltrasonicSensor(SensorPort.S2);
static LCD Screen = new LCD();
static NXTRegulatedMotor leftMotor = Motor.A;
public static void main(String[] args) throws Exception
{
boolean start = false;
if(Button.ENTER.isPressed())
{
start = true;
}
while(start)
{
if(seeker.hasDirection())
{
LCD.drawString("ja", 5, 5);
}
else
{
LCD.drawString("Nein", 5,5);
}
if(Button.ESCAPE.isPressed())
{
start = false;
}
}
}
}
please help me. I'm despairing...
