Read ADC from 2 joysticks with STM32F4xx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-06-19 5:38 AM
My project is a two-player Pong game using two joysticks, with each joystick controlling one paddle. The user interface was created using Touch GFX. The board is an STM32F429, and I have configured ADC1 to use channels 0 and 8. I’m using interrupts, but both paddles are currently being controlled by joystick 1, and joystick 2 has no effect. The adc_value1 and adc_value2 values read from the two joysticks via UART are identical.
Please help me correctly read the value from each joystick so that each paddle is controlled properly.
Thank you.
- Labels:
-
STM32F4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-06-19 7:54 AM
Hello @trungvan,
I recommend checking out the example provided at this link: BSP example for STM32F429ZI-Nucleo: This example shows how to use the joystick feature.
This example might offer useful insights and solutions for your application.
I hope my response has been helpful. If your question is resolved, please mark this topic as the solution, as it will assist others in finding the answer more quickly.
Thank you for your contribution.
Dor_RH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-06-19 7:58 AM
What joysticks?
JW
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-06-19 8:29 AM
I am using two HW-504
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-06-19 9:04 AM
show some code, attached your IOC file
Don't worry, I won't byte.
TimerCallback tutorial! | UART and DMA Idle tutorial!
If you find my solution useful, please click the Accept as Solution so others see the solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-06-19 9:14 AM
So something like this:
https://www.aliexpress.com/item/1005008086523681.html
@trungvan wrote:The board is an STM32F429
That's just a chip part number - it doesn't identify what board you have.
The hardware is an essential part of the project - so you need to give full details.
See: How to write your question to maximize your chances to find a solution.
A complex system designed from scratch never works and cannot be patched up to make it work.
