Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma config(I2C_Usage, I2C1, i2cSensors)
- #pragma config(Sensor, dgtl6, touchSensor1, sensorTouch)
- #pragma config(Sensor, dgtl7, touchSensor2, sensorTouch)
- #pragma config(Motor, port2, blue, tmotorVex393_MC29, openLoop, reversed, driveRight, encoderPort, I2C_1)
- //---------------------------------------------------------------------------------------------------------------------------------
- task main()
- {
- //Loop Forever
- while(1 == 1)
- {
- if(SensorValue(touchSensor1) == 1 )
- {
- motor[blue]= 40;
- }
- else if(SensorValue(touchSensor2) == 1)
- {
- motor[blue]= -40;
- }
- else
- {
- motor[blue] = 0;
- }
- }
- }
Add Comment
Please, Sign In to add comment