Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

In this lab exercise you will program the MSP 430 board to light two LEDs when a

ID: 1715158 • Letter: I

Question

In this lab exercise you will program the MSP 430 board to light two LEDs when a two switches are manipulated. Specifically:

1. When on board SW2 is pressed, on board LED2 is NOT lit. When SW2 is NOT pressed, LED2 is lit.
2. When external SW3 (port 1.4) is slid to “ON”, external LED3 is NOT lit. When external SW3 (port 1.4) is slid to “OFF”, external LED3 is lit.

Your group must show/demonstrate the final circuit and answer any questions the TA has. During the lab check-out, hand in the lab check out form (include your names on it!). Note that there is partial credit for this lab – you can earn points for getting only the onboard switch and LED to work (without the external switch and LED).

Steps

1. Write the code to turn on the board LED2 whenever SW2 is NOT pressed. This should run forever. (Hint: what instruction causes code to run “forever”? There will be only one line of code, an “if” statement, inside this run forever loop). Compile, download, and run this functionality.

2. Build the circuit described below, attach it to the board.

3. Add to the existing code the additional instructions to light external LED3 when external SW3 is slid to “OFF”.

Explanation / Answer

MOV P0, #430H // Initializing push button switches and initializing LED in OFF state.

READSW: MOV A, P0 // Moving the port value to Accumulator.

RRC A // Checking the value of Port 0 to know if switch 2 is ON or not.

JC NXT // If switch 1 is OFF then jump to NXT to check if switch 2 is ON.

CLR P0.7 // Turn ON LED because switch 2 is OFF.

SJMP READSW // Read switch status again.

NXT: RRC A // Checking the value of Port 0 to know if switch 2 is ON or not.

JC READSW // Jumping to READSW to check status of switch 2 again (provided switch 2 is OFF).

SETB P0.7 // Turning OFF LED because switch 2 is ON.

SJMP READSW // Jumping to READSW to read status of switch 2 again.

END

Now using Raspberry Pi, Node.js and a LED. We will be add LED 3 on this logic board also and this can be work upon morse code.

README.md

index.js

morseCode.js

package.json

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote