MIC511 PIC Lab 2 1
MIC511 PIC Lab 2 1
Group Leader:
Group Members:
Score Table:
EXPERIMENT NO. SCORE
TOTAL SCORE
PERCENTAGE
Instructor’s Remarks:
EXPERIMENT NO. 11
For Loop Running Lights
Objective:
• Create a program that will loop indefinitely.
• The program will turn ON and OFF the LED at port D starting at RD0 up to port RD7 and back
again.
Objective:
• Create a program that will loop for 5 times.
• The single LED connected at RC3 must turn ON and OFF with a delay of 1 second.
Objective:
• Set pins RB1 and RB2 of port B as input ports.
• Set pin RD4 of port D as output port.
• If RB1 is high, turn RD4 ON for 10 seconds.
• If RB2 is high, turn RD4 ON and OFF for 8 cycles with a delay of 1.5 seconds.
Objective:
• Create a program that will loop indefinitely.
• Connect the LED at port B.
• Turn ON and OFF LED’s at port B starting from; RB0 & RB7; RB1 & RB6; RB2 & RB5; RB3 &
RB4; RB2 & RB5; RB1 & RB6; and RB0 & RB7 with a 0.8 second delay.
Objective:
• Create a program that will loop indefinitely.
• Connect output LEDs at port C.
• Connect a button of port B RB0 and use its click function.
Objective:
• Create a program that will loop indefinitely.
• Connect output LEDs at port B.
• The code must read the button on RD0 and check if it is high for 100 iterations.
• If 100 is accomplished, the code will trigger and advance the LED on from RB7 to RB6 and so on.
Objective:
• Create a program that will loop indefinitely.
• Connect a Piezo Sounder on Port D at pin RD3.
• Configure RD3 so that it will play a sound at different frequencies of 1300Hz, 1500Hz, 2000Hz,
2500Hz, and 3000Hz with a duration 250ms each.
Objective:
• Create a program that will loop indefinitely.
• Connect a Piezo Sounder on port D’s pin RD3.
• Connect 4 switches on at RB3, RB4, RB5 and RB6. Each switch must produce a different tone.
Objective:
• Create a program that will count-up indefinitely.
• Connect a 7-segment display common cathode at port C.
Objective:
• Create a program that will count down indefinitely.
• Connect a 7-segment display common anode at port D.