I am trying to write a simple program where the robot(Lego NXT2) will follow a blue line.
#pragma config(Sensor, S1, , sensorCOLORBLUE)
//!!Code automatically generated by 'ROBOTC' configuration wizard !!//
task main()
{
while(true)
{
if(SensorValue[S1] == sensorCOLORBLUE)
{
motor[motorB] = 0;
motor[motorC] = -50;
}
else
{
motor[motorB] = -50;
motor[motorC] = 0;
}
}
wait1Msec(1);
}
I am using an nxt color sensor and the problem is that only 1 motor is moving. I know that none of the motors are broken either because I tested them out. Can somebody help me diagnose my problem?
wait1Msec(1)
is outside your while loop, which is probably unrelated to your problem but still a red flag. $\endgroup$