My students an I are working on 3 line sensors. We tried the new code given to me by the unofficial tech support, but are still having a problem of the left motors continually running. The following is the code we have modified to try and get it to work. Any ideas would be greatly appreciated!
#pragma config(Sensor, in1, leftlinesensor, sensorLineFollower)
#pragma config(Sensor, in3, rightlinesensor, sensorLineFollower)
#pragma config(Sensor, in4, middlelinesensor, sensorLineFollower)
#pragma config(Sensor, dgtl6, button, sensorDigitalIn)
#pragma config(Motor, port1, leftmotor, tmotorVex393_HBridge, openLoop, driveLeft)
#pragma config(Motor, port10, rightmotor, tmotorVex393_HBridge, openLoop, reversed, driveRight)
//!!Code automatically generated by ‘ROBOTC’ configuration wizard !!//
task main()
{
while(1==1){
}
if(SensorValue(middlelinesensor) > 1000){
motor[leftmotor] = 100;
motor[rightmotor] = 100;
}
else if(SensorValue(leftlinesensor) > 1000){
motor[leftmotor] = 127;
motor[rightmotor] = 0;
}
else if(SensorValue(rightlinesensor) > 1000){
motor[leftmotor] = 0;
motor[rightmotor] = 127;
}
}
}