Question
Instructions given. Using DISCO-L476VG board. 1. Configure the USER_BUTTON input as in external interrupt. Configure this interrupt to call an Interrupt Service Routine (ISR) on
Instructions given. Using DISCO-L476VG board.
1. Configure the USER_BUTTON input as in external interrupt. Configure this interrupt to call an Interrupt Service Routine (ISR) on the falling edge of the button (when the button is pressed). Write an ISR that toggles LED1 every time the button is pressed.
2. Add code to configure another interrupt that is triggered by the rising edge of the USER_BUTTON input (when the button is released). Add another ISR that configures a timer to turn LED1 off after a delay of one second.
3. You code should not turn on LED1 when the blue button is pressed and then turn off the LED 1 second after the button is release.
Code written according to instructions. Code is FUNCTIONAL.
Questions needing answers to.
Explain what interrupts you configured and why.
Explain how to configure a timer, how to read the timer in real-real time, and how to configure interrupts at 2, 10, and 100 second intervals.
How would you use timers and an oscilloscope or logic analyzer to measure the CPU clock if you didnt know it?
include "mbed.h" Ticker turnoff Interrupt!n button(PA-0); DigitalOut led1 (LED1); Digitalout led2 (LED2); void ledoff() led1-0; void flip) ed1=1; turnoff.attach (&ledoff,1.0); void rise) int main) button.fall (&flip); button.rise(&rise); include "mbed.h" Ticker turnoff Interrupt!n button(PA-0); DigitalOut led1 (LED1); Digitalout led2 (LED2); void ledoff() led1-0; void flip) ed1=1; turnoff.attach (&ledoff,1.0); void rise) int main) button.fall (&flip); button.rise(&rise)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started