4) Wire up the Circuit
- Place the XBee adapter into the breadboard and wire up the power buses to each other. Next, connect the VCC terminal of the XBee adapter to the positive rail and the ground terminal to the negative rail.
- The joystick is really a set of four switches that all share a common ground. To make it easier to connect them to a breadboard, you can solder male header pins onto each. We kept the common wire (typically the black one) separate so that it could be connected directly to the negative power rail.
- Connect the common wire to the ground power rail. Connect the remaining joystick switch wires to XBee input pins D0, D1, D2 and D3 (physical pins 20, 19, 18 and 17 on the right-hand side of the XBee).
- We made it easier to attach the battery holder to the breadboard by soldering some male headers onto its positive and negative wiring leads.
- Connect the battery pack directly to the ground and power rails.
- Insert your configured XBee into the breadboard adapter and your XBee Joystick is all done!
- Above is a breadboard layout of the circuit along with a schematic.
Note: Your joystick output wiring arrangement might be different, so always check the operation to confirm before finalizing your project.