Hey!
We're doing a project about a line follower NXJ with a moving sensor on the front of the robot.
To track if there's a line we use for-loops for every degree it turns (we use motor port A) and track the light sensor readings. But this makes the sensor really slow and the motion is very 'laggy' and unstable.
Anyone who can help us getting a more smooth circular motion?
Our loop looks something like this:
for (int v=0; v<80; v = v+1){
if(Motor.A.isMoving()==true){
Motor.A.flt();
}
else{
Motor.A.rotate(1);
}
int vinkel = Motor.A.getTachoCount();
LCD.clearDisplay();
LCD.refresh();
LCD.drawInt(vinkel, 3, 9, 0);
LCD.refresh();
}
Didnt include the light sensor part, since that's not the problem at the moment. Her its only rotating about 80 degrees to the right, so we got 3 more of these (80 degrees each) to cover the 160 degree vision field.
Appreciate it!
Regards
Henrik
