Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma config(Sensor, dgtl1, rightouch, sensorTouch)
- #pragma config(Sensor, dgtl2, lefttouch, sensorTouch)
- #pragma config(Motor, port2, rightMotor, tmotorServoContinuousRotation, openLoop, reversed)
- task main()
- {
- while (1==1)
- {
- if(SensorValue [rightouch]==1)
- {
- motor[rightMotor]= 40;
- }
- else if (SensorValue [lefttouch]==1)
- {
- motor[rightMotor] = -40;
- }
- else
- {
- motor[rightMotor] = 0;
- }
- }
- }
Add Comment
Please, Sign In to add comment