Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I have this code for my Tiva Launchpad that currently blinks the red LED at about 1ms on and off. I need to alter the
I have this code for my Tiva Launchpad that currently blinks the red LED at about 1ms on and off. I need to alter the code the complete the following task
3. Now, modify the code such that the application turns the red LED on for 80ms, then turn it off for 80ms. The blue LED does the same but for 2 times. Then, the green LED does the same for 3 times. Then, the cycle repeats. See the logic analyzer screenshot below. There is always a delay between blinks even for the same LED color; e.g. turn Red On 80ms delay turn Red Off 80 ms delay turn Blue On 80 ms delay turn Blue Off 80ms delay turn Blue On 80 ms delay turn Blue Off 80 ms delay turn Green On 80ms delay etc. See figure below. lefine PortF_Den (*((volatile unsigned int*) 04002551C)) run mode clock gating register *l define RcgcGpio (* ((volatile unsigned int*)0x400FE608)) oid delayMs(int n);; function prototype for delay / int main (void)\{ 1* enable clock to GPIOF at clock gating register */ RcgcGpio =020; 1 set PORTF pin3-1 as output pins / I* set PORTF pin3-1 as digital pins */ PortF_Den = 0xE; while(1)\{ I* write PORTF to turn on LEDS % //PortF_Data = 0xE; // White (all 3 LEDs ) PortF_Data =002;// Red. //PortF_Data =064; // Blue //PortF_Data =008;// Green delayMs(500); I* write PORTF to turn off all LEDs */ PortF_Data =0; delayMs (500); H//while 3// main I* delay in milliseconds (assuming 16MHz (PU clock) */ void delayms(int n)f int i,j; for(i=0;iStep 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