Question: Write a program in C that reads a 3-bit desired light pattern from the 3 input switches connected to pins P2.3-P2.5 and displays the patter

Write a program in C that reads a 3-bit desired light pattern from the 3 input switches connected to pins P2.3-P2.5 and displays the patter on the 8 LEDs with some rotation options based on the other 3 switches.

[4] 3.a)Switch on Port2.0 (Read/Rotate mode)

On (logic 0) Read mode: Your program continuously reads the switches and takes only the 3-bits (Port 2.3-2.5) as a desired display pattern and displays them on the LEDs (Port 1.3-1.5). All other LEDs on Port 1 are masked to zero (turned off).

Off (logic 1) Rotate mode: Once this switch is turned off, your program will rotate the pattern on the 8 LEDs connected to Port1 pins 0-7. The pattern is the 3-bit value you constantly updated and saved during the Read mode.

[4] 3.b)Switch on Port2.1 (Left/Right direction mode)

On (logic 0) The LED pattern rotates to the left Off (logic 1) The LED pattern rotates to the Right.

[4] 3.c)Switch on Port2.2 (Fast/Slow speed mode) **Hint: Software Delay**

On (logic 0) The patter rotation is Fast.

Off (logic 1) The patter rotation is Slow

using msp430.h

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!