Controlling Servos while Driving Remotely
Controlling Servos while Driving Remotely If you have normal servos, this code will work well for you…
Continuous Rotation Servos
Continuous rotation servos are made to spin contin
0
full speed clockwise
50
slower clockwise
128
stopped
200
slower counter-clockwise
255
full speed counter-clockwse
If you have continuous rotation servos, try something more like this:
Notes:
1) The variable called left actually has multiple values stored in it (it is a list variable). Value 1 is the Y axis while value 2 is the X axis. When mixer mode is on, value 1 and value 2 change so that the X and Y values get mixed so that the right motor can be controlled by value 1 and the left motor can be controlled by value 2 and only 1 joystick needs to be used.
2) The buttons on the virtual gamepad read 1 when they are pressed and 0 when they aren’t. A simple if statement can help you control your servos with your buttons.
Suggestions:
1) You may want to program in an automatic forward drive button or an automatic 90 degree rotation button so that you can quickly and precisely move around the field during your matches.
Last updated
Was this helpful?