what i’m trying to do is make it so depending what position I put my potentiometer is in, different motors will move. this is what I have so far:
[INDENT]#pragma config(Sensor,in1,pot,sensorPotentiometer)
task main(){
if(SensorValue[pot] < 255){
motor[port3] = 100;
wait1Msec(1000);
}else if(SensorValue[pot] < 550){
motor[port2] = 100;
wait1Msec(1000);
}else if(SensorValue[pot] < 787){
motor[port3] = -100;
wait1Msec(1000);
}else{
motor[port2] = -100;
wait1Msec(1000);
}
}
[/INDENT]
when I run the program, the robot will move motor[port2] backwards if the pot is in 3/4 of it’s range, and will move motor[port3] forward if it’s in another corner of the pot.
any help would be appreciated!