Desktop RoboTurret - I2C Control - Wii Nunchuk

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.

2C Control - Wii Nunchuk

I22 (Also called IIC) is a communication protocol that can connect multiple devices together using just 2 data pins. This can be very helpful for adding input/output functionality for very few I/O pins. For example, by attaching a Wii Nunchuk to the Geekduino with 2 I/O pins, you get the following following sensors:

  • 2 Potentiometers (Joystick)
  • 2 Pushbuttons
  • 1 Accelerometer

The Wii Nunchuk code can be found at:

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

Wiring for joystick control is as follows:

Device Pin Type Pin #
Pan Servo Digital 10
Tilt Servo Digital 11
Laser Digital 2
Wii Nunchuk Adaptor I2C I2C Port
b_500_500_16777215_00__images_tutorials_desktopRoboTurret_roboTurret_nunchuk_bb.png
  • By changing the JOY_SEN(for joystick) or ACC_SEN(for accelerometer #define statement, you can adjust the sensitivity of the joystick. Lower value = more sensitive, higher value = less sensitive.
  • If your turret is 'drifting', or moving while you don't want it to, you may need to increase the JOY_DEADZONE (for joystick control) or the ACC_DEADZONE(for accelerometer control) #define statements.
  • Alternatively, if your is not responding to small movements on the joystick, you may need to decrease the JOY_DEADZONE (for joystick control) or the ACC_DEADZONE(for accelerometer control) #define statements.

Feedback Form