Code: #pragma config(Sensor, dgtl7, soleniod1, sensorDigitalOut) #pragma config(Sensor, dgtl8, soleniod2, sensorDigitalOut) #pragma config(Sensor, dgtl9, solenoid3, sensorDigitalOut) #pragma config(Motor, port2, right, tmotorNormal, openLoop) #pragma config(Motor, port3, left, tmotorNormal, openLoop, reversed) //*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
task main () { while(true) // Loop Forever
if(vexRT[Btn6U] == 1) // If button 6U (upper right shoulder button) is pressed: { SensorValue[soleniod1] = 1; // …activate the solenoid. } else // If button 6 (upper right shoulder button) is NOT pressed: { SensorValue[soleniod1] = 0; // ..deactivate the solenoid. }
if(vexRT[Btn6D] == 1) // If button 6U (upper right shoulder button) is pressed: { SensorValue[soleniod1] = -1; // …activate the solenoid. } else // If button 6 (upper right shoulder button) is NOT pressed: { SensorValue[soleniod1] = 0; // ..deactivate the solenoid. }
} |