PA0 to transition from low to high, increments an unsigned
integer variable upon detecting the transition, and then writes
out the value of the variable to the PC's terminal program after
each low-to-high transition.
Include program listing and explanation of how the program
works.
clear_pin() or
set_pin() kernel functions. Draw a labelled
schematic for your circuit and draw a picture showing the
layout of circuit components on your breadboard. You
should arrange your breadboard layout so the LED display is
in the upper righthand corner of the breadboard. In your
lab book include the schematic diagram and breadboard
layout. Also provide an explanation of of how the LED
circuit works.
clear_pin
and set_pin kernel functions to display that digit
on your LED display. A partial example of such a function
is provided below.
void display_digit(int data){
int i;
for(i=1;i<8;i++) set_pin(i);
switch (data){
case 0:
clear_pin(1);clear_pin(2);clear_pin(3);
clear_pin(4);clear_pin(5);clear_pin(6);
break;
case 1:
clear_pin(2);clear_pin(3);
break;
}
}
This function accepts the integer data and sets the
appropriate pins on the 7 segment LED display to show
either a 0 or 1.
Include a listing of your final function in your lab book and discuss
how the program works.