Since any PORTB pin is able to source a max. of
20mA per pin with PORTB capable of sourcing a max-
imum total current of 100mA, hence we can use PORTB
to drive LED display directly. As shown in the circuit,
8 LEDs are connected to PORTB with each 120 Ohm current
limiting resistor
The following code,
led.c
demonstrate how to output and turn on & off the LEDs. The program
blinks the series of LEDs from LED1 to LED8 turning on & off one
after another sequentially. When it reaches LED8, it repeats the
process all over again starting at LED1.
|