Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Requirements: 1. All LEDs are initially off 2. When the button is pushed the first time the red led blinks at a rate of
Requirements: "
1. All LEDs are initially off 2. When the button is pushed the first time the red led blinks at a rate of 5Hz 3. When the button is pushed the second time the blue led blinks at a rate of 8Hz 4. When the button is pushed a third time all the LEDs shutoff. 5. Repeat this pattern
You should use the button, LEDS, debouncer, and interrupts to accomplish this program."
My code is down below. Can you please tell me what's wrong with it, it is not blinking?
Note: This is a beginners thing, we are only allowed to use a handful of tools.
#include "project . h" #define ON Oxon #define OFF 0x01 CY ISR (Handle Button) if (RLED_Read )OFF BLED Write (OFF): RLED Write (!RLED Read)) CyDelay (200): else RLED Write (OFF): CyDelay (125); EXVJ')) Wr::i.ix: ( !')) BLED Write!BLED Ik:ad () ) ; Button_clearInterruptO; int main (void) CyGlobalIntEnable: //Initilize LEDS RLED Write (OFF): BLEDWrite (OFF) ; - //Start ISR ISR_Button_StartEx (Handle_Button); for ) Place your application code here
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