#include "ledinit.h" #include <ez80F91.h>
#define DELAY 500 unsigned char *ledan; /* LED Anode */ unsigned char *ledca; /* Led Cathode */ void delay() { int j; for (j=0; j<DELAY ;j++){ } } //This block turns on respective anode and cathode bits of Led //matrix to display character ' C ' while(1){ *ledca = 0x11; *ledan = 0x01; delay(); *ledca = 0x0E; *ledan = 0x02; delay(); *ledca = 0x0F; *ledan = 0x04; delay(); *ledca = 0x0F; *ledan = 0x08; delay(); *ledca = 0x0F; *ledan = 0x10; delay(); *ledca = 0x0E; *ledan = 0x20; delay(); *ledca = 0x11; *ledan = 0x40; delay(); }
Listing 1—After I matched the discreet LEDs with their respective bits, I had a blast playing with the lights.