Answered step by step
Verified Expert Solution
Link Copied!

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
image text in transcribed
image text in transcribed
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;i<>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Postgresql 16 Administration Cookbook Solve Real World Database Administration Challenges With 180+ Practical Recipes And Best Practices

Authors: Gianni Ciolli ,Boriss Mejias ,Jimmy Angelakos ,Vibhor Kumar ,Simon Riggs

1st Edition

1835460585, 978-1835460580

More Books

Students also viewed these Databases questions