

Without this resistance, invalid numbers are output that can not be clearly assigned. For this to be either 0 or 1023 (pressed or not pressed) a 10kΩ resistor is attached to VCC. The term SW is for the button that is activated when you press the joystick. MCP3008 IC (analog-to-digital converter)Īlthough the joystick has a 5V input voltage, it works without problems using 3.3V, which is even more important when using the MCP3008.3.2mV are steps that can be mapped (3.3V). With an input voltage of 3.3V, the approx. 1024 bit combinations (the values from 0 to 1023). This means that it can reach a maximum of 2 ^ 10, i.e.

The MCP3008 device is a 10-bit analogue-to-digital converter. On the right side are the digital outputs, where the transmission takes place via DIN and DOUT. On the left side are 8 analogue inputs, of which we only need 3. So that the position can also be read out digitally on the Raspberry, the MCP3008 is needed. These analogue joysticks have two axes, which allow a certain voltage to pass through two potentiometers (adjustable resistance). Connecting and reading a joystick is shown in this tutorial. Since these usually work purely analogously, the signal has to be converted, which we do with the MCP3008 chip.

