In this activity, a simple reaction time using RT-Spark, and RGB LED. The LED turns on after 1 to 3 seconds, and the user must press the button as fast as possible. The system measures the reaction time using a software counter, and an oscilloscope is used to verify the timing. This is to understand interrupts, GPIO control, and basic real-time system behavior.
Step 1: Create Project
First, open STM32CubeMX and create a new project. Select the RT-Spark STM32 board or the correct microcontroller. This is where the hardware configuration starts.
Next, PC0 was configured a GPIO_EXTI0. This allows the pin to detect button presses using an external interrupt for fast response in the reaction time test.
Go to System Core then NVIC and enable the interrupt for EXTI line 0. This allows the system to detect when the button is pressed.
Go to the Project Manager tab in STM32CubeMX and click Generate Code to create the project files in STM32CubeIDE.
Step 6: Open Project in STM32CubeIDEFinally, open the generated project in STM32CubeIDE. This is where the RT-Spark reaction time program will be written and executed






Comments