RobotGeek Foam Dart Gun Getting Started Guide

This guide will teach you how to connect and use the RobotGeek Foam Dart Gun.

This guide will refer to the RobotGeek Geekduino, the Arduino Compatible microcontroller recommended for use with RobotGeek products. However this kit will also work with the Arduino Uno, or other Arduino variants like the Seeeduino.

Setting up the Arduino Software

Geekduino Getting Started Guide

If you have not already set up your Geekduino/ Arduino compatible board, please see the Geekduino Getting Started Guide. This guide will assist you in getting set up with the Arduino software as well as install libraries and test sketches for RobotGeek Robots and this LCD display.

Assembly

Assembly Guide

Wiring the Dart Gun - Auto Test

The RobotGeek Foam Dart Gun will work with any device that can control a PWM hobby servo. It was designed for use with the RobotGeek Sensor Shield. The servo will connect directly to the Sensor Shield's PWM port using a 3 Pin Sensor Cable. You will need to set your power jumper for PWM pins 9/10/11 to 'VIN'.

Device Pin
Trigger Servo (RobotGeek Servo) DIO-9
b_500_500_16777215_00__images_tutorials_dartGun_single-RG-servo_bb.png

Testing the RobotGeek Foam Dart Gun - Auto Test

During the inital testing phase, you should remove the M3*10 bolt that connects the Servo Horn Trigger Arm to the standoffs. This will prevent damage to the arm/servo.

When you installed the RobotGeek Tools and Libraries, you installed the examples for the Foam Dart Fun. You can find the foamDartGunAutoTest sketch in the 'Tests' folder.

File -> Sketchbook -> RobotGeek sketches -> Tests -> foamDartGunAutoTest

Now load the sketch onto your Geekduino. If everything is hooked up correctly the servo should move slightly toward the trigger, then move back to its home position.

If the servo moves outside the trigger area, you will need to make sure your servo is centered and that your Trigger Arm is installed correctly.

Once the Trigger Arm is moving correctly, you can use the M3*10 bolt to re-attach the Trigger Arm to the standoffs. Pull out the cocking mechanism on the dart gun and reset or power cycle the Geekduino to fire the gun.

If your servo is moving but the gun is not firing, you may need to adjust the angle the servo moves to while firing the gun. Find the following line

#define FIRE_POSITION 113

and change it to

#define FIRE_POSITION 114

If this does not work, keep increasing the number by 1 until your gun fires reliably.

Wiring the Dart Gun - Pushbutton

This version of the test uses a pushbutton to activate the foam dart gun

Device Pin
Pushbutton DIO-4
Trigger Servo (RobotGeek Servo) DIO-9
b_500_500_16777215_00__images_tutorials_dartGun_single-RG-servo-button_bb.png

Testing the RobotGeek Foam Dart Gun - Button Test

This code will allow you to control the foam dart gun with a pushbutton. If you have not first tested the 'automatic' code above, please do so first to make sure your servo is aligned correctly.

When you installed the RobotGeek Tools and Libraries, you installed the examples for the Foam Dart Fun. You can find the foamDartGunButton sketch in the 'Tests' folder.

File -> Sketchbook -> RobotGeek sketches -> Tests -> foamDartGunButton

Use the value of FIRE_POSITION you found in the previous step.

Now load the sketch onto your Geekduino. If everything is hooked up correctly the servo should move to fire the gun whenever you press the button.

This code is designed to work with a bare button with no pullup resistor - the code is using the Geekduino's internal pullup resistor. If you with to use a button that has a built in resistor like the RobotGeek Pushbutton, you will need to change

pinMode(PUSHBUTTON, INPUT_PULLUP);

to

pinMode(PUSHBUTTON, INPUT);

and from

if (digitalRead(PUSHBUTTON) == LOW)

to

if (digitalRead(PUSHBUTTON) == HIGH)	

Feedback Form