Receive keypad input using the timer interrupt of the STM32.
- April 7, 2025
- 1 reply
- 1511 views
and main.c code is as follows.
After debugging, I confirmed through the live expression window that current_index changes periodically due to the timer interrupt.
I wrote code that processes the keyPressed value based on row input only when a specific current_index (i.e., a specific column is HIGH), using statements like if (current_index == 0); for each value from 0 to 3.
However, in the live expression window, I observed that keyPressed keeps changing sequentially from '1' to 'D' at every timer cycle, even without pressing any key. Eventually, the message “failed to evaluate expression” appeared, and I couldn’t monitor the value anymore.
Question 1. Is the above code appropriate for the keypad behavior I want (i.e., when I press '1', '1' is stored in keyPressed, and when I press '*', '*' is stored)?
Question 2. How can I solve the “failed to evaluate expression” issue?
I’ve already tried “freshen all files,” rebuild, and adjusting the debug level, but nothing worked.
I’d really appreciate your help…
