Qwerk Customization and Tekkotsu

Index Adding a switch Adding a bump sensor Adding an LED Adding raygun special effects Adding a range sensor

Adding a Switch

There are many kinds of switches you can add to a Qwerk. The simplest is a "single throw" switch, i.e., an ordinary on/off switch. But the most convenient is a "double throw" switch, because it can be wired in directly with no additional components. Both kinds of switches can be found at any Radio Shack. For most applications you will want a momentary (pushbutton) switch that is only "on" while the button is pressed, but you can also use other types such as toggle or rocker switches that flip between "on" and "off" modes. Momentary, toggle, and rocker switches are all available in either single throw or double throw configurations.

A double throw switch has three leads, sometimes labeled NC (normally closed), NO (normally open), and C (common). The common lead is usually the one in the middle. To add a double throw switch to your Qwerk, wire the normally closed lead to ground, the normally open lead to +5V, and the common lead to one of the analog input ports.

A single throw switch has two leads. To wire a single throw switch to your Qwerk, you will need to add a pulldown resistor to hold the analog input line at ground when the switch is open; when the switch is closed it will pull the line up to +5V, and the resistor will limit the current flow. The value of the resistor isn't critical; anything from 10 ohms and up should be fine (5 ohms is the absolute lowest).For source be sure to check out the code for the bump sensor, as it's actually just a single throw switch.


Scott McCaffrey and Dave Touretzky

Last modified: Thu May 13th 2008