diff --git a/src/SUMMARY.md b/src/SUMMARY.md index bf8f61d..9002aed 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -97,4 +97,9 @@ - [Write Data](./rfid/write-data.md) - [Change Auth Key](./rfid/change-auth-key.md) - [Project Ideas](./rfid/project-ideas.md) +- [Joystick](./joystick/index.md) + - [Movement and ADC](./joystick/movement-and-12-bit-adc-value.md) + - [Pin layout](./joystick/pin-layout.md) + - [Circuit](./joystick/circuit.md) + - [Print ADC Values](./joystick/print-adc-values.md) - [Projects](./projects.md) diff --git a/src/joystick/circuit.md b/src/joystick/circuit.md new file mode 100644 index 0000000..4e3ba73 --- /dev/null +++ b/src/joystick/circuit.md @@ -0,0 +1,68 @@ +# Connecting the Joystick to the ESP32 + +Let's connect the joystick to the ESP32. We need to connect the VRX and VRY pins to the ADC pins of the ESP32. The joystick will be powered with 3.3V instead of 5V because the ESP32's GPIO pins are only 3.3V tolerant. Connecting it to 5V could damage the ESP32's pins. Thankfully, the joystick can operate at 3.3V as well. + + +
ESP32 Pin | +Wire | +Joystick Pin | +
---|---|---|
GND | +
+
+
+
+
+ |
+ GND | +
3.3V | +
+
+
+
+
+ |
+ VCC | +
GPIO 13 | +
+
+
+
+
+ |
+ VRX | +
GPIO 14 | +
+
+
+
+
+ |
+ VRY | +
GPIO 32 | +
+
+
+
+
+ |
+ SW | +
The reason it is 1.65V in the center position is that the potentiometer acts as a voltage divider. When the potentiometer is moved, its resistance changes, causing the voltage divider to output a different voltage accordingly. Refer the voltate divider section.
+Joystick Pin | +Details | +
---|---|
GND | +Ground pin. Should be connected to the Ground of the circuit. | +
VCC | +Power supply pin (typically 5V or 3.3V ). | +
VRX | +The X-axis analog output pin varies its voltage based on the joystick's horizontal position, ranging from 0V to VCC as the joystick is moved left and right. | +
VRY | +The Y-axis analog output pin varies its voltage based on the joystick's vertical position, ranging from 0V to VCC as the joystick is moved up and down. | +
SW | +Switch pin. When the joystick knob is pressed, this pin is typically pulled LOW (to GND). | +