Desktop RoboTurret - Direct Control - Joystick

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.

Feedback Form