Question: I need help writing this program assignment in C language, thank you. For this assignment were using PIC18F4620. Write an endless loop where the lowest

I need help writing this program assignment in C language, thank you. For this assignment were using PIC18F4620.

Write an endless loop where the lowest three pins of the DIP Switch SW1 (pins connected to port A bits 0 through 2) are read and then these three bits are outputs to the port C whereas the following color will be generated on the LED D1:

I need help writing this program assignment in C language, thank you.

Note: . Dont forget to add the TRISB command for this port B in your code. Show the operation of this part by changing the switch settings of SW1 and check that the color of the RGB LED D1 matches with the combination of the switch. Make sure that the most significant bit of SW1 is on the left side of that switch and the LSB is on the right side.

Inputs (SW1) Outputs (D1) 0.00 RA2 RAI RAO 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 1 0 1 1 1 fo-ord 0000 RB2 RB1 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1 RBO Color 0 No light 1 Red 0 Green 1 Yellow 0 Blue 1 Purple 0 Cyan 1 White

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!