Introduction
Video game controllers use exactly this component to sense which direction you're pushing the stick. In this experiment, we're wiring up a dual-axis analog joystick module to the STM32F070RB and continuously reading three separate values from it, how far it's tilted left or right, how far it's tilted forward or back, and whether its built-in button is currently pressed down. All three values get printed to a PC over UART so you can watch them change live as you move the stick.
2. Scope
This experiment covers reading two separate analog channels from the ADC in sequence, reading a simple digital push-button with an internal pull-up, and combining all three readings into one continuously updating line of text printed over UART. By the end, the operator will understand how a single input device can combine both analog and digital sensing inside one module, and how to configure the ADC to sample more than one channel in a single project.
3. Prerequisite
3.1 Hardware
-
STM32 Nucleo-F070RB development board
-
Dual-axis analog joystick module with an integrated push-button
-
Breadboard and jumper wires
-
Micro-USB cable
-
PC with PuTTY
3.2 Software
-
STM32CubeMX (standalone)
-
STM32CubeIDE
-
ST-LINK USB driver
-
PuTTY, or an equivalent serial terminal application
Community Q&A
0 questionsAsk questions and get answers from our community and staff moderators.
No questions yet — be the first to start the conversation!
Ask a Question
Please log in to ask a question or post a reply.
Login to Participate