Question: Modify the following code so that the blue, red, and green LED lights of D3 will turn on one at a time and cycle through

Modify the following code so that the blue, red, and green LED lights of D3 will turn on one at a time and cycle through endlessly.

Modify the following code so that the blue, red, and green LED

I am using the MSP4302553. The schematic for the D3 RGB LED is below:

lights of D3 will turn on one at a time and cycle

I get that the code will change to represent utilizing port 2 pins 5, 3, and 1.

So I believe it will start off like this:

P2DIR |= BIT5+BIT3+BIT1

and then follow the instructions to make it perform as required.

How do I get them to turn on and off individually in a cycle? Thanks!

#include * main.c */ int main(void) { WDTCTL - WDTPW | WDTHOLD; // Stop watchdog timer // Set Port 1 channel O as an output pin PIDIR = BITO+BIT6; for (;;) { volatile unsigned int k=0; // Toggle the output signal between 0 and 1 P10UT ^= BITO; // Keep the signal level for some duration do (k++); while (k * main.c */ int main(void) { WDTCTL - WDTPW | WDTHOLD; // Stop watchdog timer // Set Port 1 channel O as an output pin PIDIR = BITO+BIT6; for (;;) { volatile unsigned int k=0; // Toggle the output signal between 0 and 1 P10UT ^= BITO; // Keep the signal level for some duration do (k++); while (k

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!