Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma config(Sensor, dgtl10, TouchUp, sensorTouch)
- #pragma config(Sensor, dgtl11, TouchDown, sensorTouch)
- /*+++++++++++++++++++++++++++++++++++++++++++++| Notes |++++++++++++++++++++++++++++++++++++++++++++++
- 2 Joystick Drive
- - This program allows you to remotely control your robot using the USB Logitech Dual
- Action Joysticks.
- - For USB values to be transmitted to the robot, you must follow several steps:
- - Use the "#include "JoystickDriver.c"" line at the beginning of your program
- - Call the "getJoystickSettings(joystick);" in a loop to repeatedly retrieve the latest values
- - Open the Robot > Debugger Windows > "Joystick Control - Basic" window after downloading your
- program to the virtual robot
- Robot Model(s): GridBot
- [I/O Port] [Name] [Type] [Description]
- Motor Port 2 rightMotor VEX Motor Right side motor
- Motor Port 3 leftMotor VEX Motor Left side motor
- *To run this sample program on Swervebot, be sure to Reverse Motor Port 3 in the Motors and Sensors
- Setup, and to make sure that Motor Port 2 is NOT Reversed.
- ----------------------------------------------------------------------------------------------------*/
- task main()
- {
- //Loop Forever
- while(1 == 1)
- {
- if(SensorValue(TouchUp)==1)
- {
- motor[armMotor] = 40;
- }
- else if(SensorValue(TouchDown)==1)
- {
- motor[armMotor] = -40;
- }
- else
- {
- motor[armMotor] = 0;
- }
- }
- }
Add Comment
Please, Sign In to add comment