Desktop RoboTurret - Direct Control - Joystick

Direct Control

This demonstration shows how to control the Desktop RoboTurret using direct control via a joystick and a pushbutton.

Download the Sketch

RoboTurret Sketches

A .zip file with all of the RoboTurret Sketches can be found here.

Unzip the file and you will have a folder called desktopRoboTurretV3-master We recommend that you create a folder RobotGeek Sketches in your Arduino user folder and put the desktopRoboTurretV3-master in there. The rest of this guide will assume you've placed your sketches in the following folder.

  Arduino -> RobotGeek Sketches -> desktopRoboTurretV3-master

This will be the same 'Arduino' folder you put your libraries and robotgeek tools in, and NOT the folder where the Arduino application is.

Direct Control - Joystick

The easiest way to control the Desktop RoboTurret is with the included Joystick and a Pushbutton. The Joystick consists of 2 self-centering potentiometers that the RoboTurret can use as Analog Inputs. The horizontal axis will control the pan servo while the vertical axis will control the tilt servo. The pushbutton can be used as a Digital Input to toggle the laser on and off.

The Joystick code can be found at:

    File -> Sketchbook -> RobotGeek Sketches -> desktopRoboTurretV3-master -> roboTurret3_joystick  

Wiring for joystick control is as follows:

Device Pin Type Pin #
Pan Servo Digital 10
Tilt Servo Digital 11
Laser Digital 2
Pushbutton Digital 4
Joystick (Horizontal) Analog 0
Joystick (Vertical) Analog 1
  • By changing the speed variable, you can adjust the overall speed of the turret. A higher value will cause the turret to move faster, while a lower value will cause it to move slower. Values from 5-500 work the best.
  • If your turret is 'drifting', or moving while you don't want it to, you may need to lower the DEADBANDLOW or increase the DEADBANDHIGH #define statements.
  • Alternatively, if your is not responding to small movements on the joystick, you may need to increase the DEADBANDLOW or decrease the DEADBANDHIGH #define statements.

PC Control These demos and projects allow the robot to be controlled via a computer.

ArbotiX Commander Control - These demos and projects control the Robot using the ArbotiX Commander, the handheld Arduino based remote control.

Direct Control - These demos and projects control the Robot directly from sensors connected directly to the Robot's control board.

Pose Control - These demos and projects allow you to create and playback a sequence of poses.

Serial Control - These demos and projects control the robot using a serial packet protocol.

Standalone - These demos and projects are deisgned to let your robot function without a computer or additional microcontroller.

Wireless Control - These demos and projects allow you to control the robot wirelessly - usually by replacing the Serial Connection with XBee modules.

Reference - These articles have technical details regarding the control and operation of the robot.


More info here

Feedback Form