Qwerk Customization and Tekkotsu
Index
Adding a switch
Adding a bump sensor
Adding an LED
Adding raygun special effects
Adding a range sensor
Adding Raygun Special Effects
Using an ordinary toy raygun that you can buy at the toy store, you can
add exciting lights and sounds to your Qwerkbot. Simply follow these
instructions:
Step 1
Disassemble the housing of the toy raygun, in this case it just took a
philips head screwdriver.
Step 2
Locate the speaker and sound card. The best way to do this is to first
locate
the speaker, which is as simple as pulling the trigger and seeing where
the sound comes from. Once you do this, the two wires attached to the
speaker should lead you directly to the sound card.

In the above picture, the round object in the top left is our speaker,
and the two red wires lead us directly to the sound card in the bottom
right.
Step 3
Before you remove the sound card be sure to make a note of what wire is
where. First locate power and ground, this is done by tracing the wires
from the battery case. The wire attached to the top side of the
battery(with a + symbol), is power, the other is ground. There should
also be a third wire attached to the trigger, make note of where this
wire goes on the sound card, and also whether it goes to ground or
power
on the battery case.

Step 4
Finally begin wiring the sound card to your Qwerkbot. First be sure
that the power is acceptable. In our case we had three AAA batteries in
the battery pack, which is equivalent to 4.5 V. In almost all cases
this is close enough to the 5 V that the Qwerkbot gives out, so wiring
power to +5v and ground to gnd is perfectly acceptable. Lastly our
trigger was wired to power, so connecting it directly to a digital
output(in our case DO2) is quite alright. Digital outputs on
the Qwerkbot put out 3.3V's, but again this was close enough that the
raygun effects still worked.
Done!
Now to access this in tekkotsu use the sample code linked to
below.
RayGunDemo.h
QBotPlusInfo.h
This
file names the RayGunOffset according to which output it's on, be sure
to change this to the output you used
Scott McCaffrey and Dave Touretzky
Last
modified: Thu May 13th 2008