// portA for row --> anode (top-0;bottom-7)
// portB for column --> cathode (right-0;left-7)
#include "ecen.h"
# define DELAY 2000000
void setup() {
volatile char *dir_A=0x21 , *dir_B=0x24;
*dir_A = 0xff, *dir_B = 0xff;
}
// Light up right-most top LED
/*void loop() {
outA((0x01));
outB(~(0x01));
}*/
// Light up left-most top LED
/*void loop() {
outA((0x01));
outB(~(0x80));
}*/
// Light up right-most bottom LED
/*void loop() {
outA((0x80));
outB(~(0x01));
}*/
// Light up left-most bottom LED
/*void loop() {
outA((0x80));
outB(~(0x80));
}*/
//Light up top most row all leds
/*void loop() {
outA((0x01));
outB((0x00));
}*/
// Display bottom most row all leds
/*void loop(){
outA(0x80);
outB(0x00);
}*/
// Display left most column all leds
/*void loop(){
outA(0xff);
outB(0x7f);
}*/
// Display right most column all leds
/*void loop(){
outA(0xff);
outB(0xfe);
}*/
// Display diagonal leds [top left - bottom right]
/*void loop(){
volatile long k;
for(int i=0;i<8;i++){
outB(~(128>>i));
outA(1<<i);
for(k=0;k<3000;k++);
outA(0x00);
}
}*/
// Display diagonal leds [top right - bottom rigleftht]
void loop(){
volatile long k;
for(int i=0;i<8;i++){
outB(~(1<<i));
outA(1<<i);
for(k=0;k<3000;k++);
outA(0x00);
}
}