Wednesday, October 30, 2013

Integrating a Joystick via I2c with a GPIO Detected Button - Hardware

The images below illustrate the wiring for a joystick that I purchased from eBay.   Here are notes corresponding to the diagram:
  1. The circuit board for the Joystick has the button wired from ground so the signal would go from high to low.   I wanted a rising signal so broke the default connection (as shown by the picture) and wired the button to the 5v supply.
  2. The output from the button is connected to a pull down resistor...
  3. ...and since the output 5v I route it through a voltage divider to make it safe for the Raspberry Pi.
  4. Each axis of the Joystick delivers a voltage that indicates the position of the controller.   These outputs are connected to the Analog Digital Convertor (ADC) using channels 2 and 3.
  5. The output from the ADC is connected to the Raspberry Pi using the SLC and SDA connections.
I will talk to the software side of the above in another post.

No comments:

Post a Comment