RobotC Help

Hi, I am using robotc, I made a program and could somebody tell me why it is not working?

const tSensors touchSensor = (tSensors) S1; const tSensors soundSensor = (tSensors) S3; const tSensors lightSensor = (tSensors) S2;

task main() { while(SensorValue(touchSensor) == 0) //loop while the touch sensor is not pressed { motor[motorB] = 100; motor[motorC] = 100; } //exit loop when touch sensor is pressed

while(SensorValue(soundSensor) >20) //loop while the sound sensor is not activated { motor[motorB] = 0; motor[motorC] = 0; motor[motorA] = 0; }

//close claw

motor[motorA] = 75; wait1Msec(500);

//turn right

motor[motorB] = 100; wait1Msec(2000);

while(SensorValue(lightSensor)

Reply to
yanjchan
Loading thread data ...

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.