Question: c) Write an endless loop to read the input switches and output the values to the LEDs. Based on the schematics shown on 'LAB2_Schematics.pdf, the

c) Write an endless loop to read the input
c) Write an endless loop to read the input switches and output the values to the LEDs. Based on the schematics shown on 'LAB2_Schematics.pdf, the four inputs should be port C bits 0 through 3 while the four LEDs should be connected to port A bits 0 through 3. Example: void main() char in; // Use variable 'in' as char TRISA = Ox??; // fill out the ?? with the proper values TRISC = Ox??; // fill out the ?? with the proper values ADCONI = Ox??; // fill out the ?? with the proper values while (1) in = PORTA; // read data from PORTA and save it // into 'in' in = in & OxOF; // Mask out the unused upper four bits PORTC = in; // Output the data to PORTC

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 Mathematics Questions!