#include "ecen.h"
#define CHARACTER 5
#define ROW 8
#define DELAY 800
// display {a to e} one by one, one second each character
uint8_t font[CHARACTER][ROW] = {
{0x00, 0x40, 0x7c, 0x4a, 0x4a, 0x4a, 0x32, 0x00},
{0x00, 0x20, 0x50, 0x50, 0x50, 0x7e, 0x00, 0x00},
{0x00, 0x00, 0x24, 0x42, 0x42, 0x3c, 0x00, 0x00},
{0x00, 0x00, 0x7f, 0x48, 0x48, 0x30, 0x00, 0x00},
{0x00, 0x00, 0x24, 0x4a, 0x4a, 0x3c, 0x00, 0x00}
};
// display 0 to 4 one by one with interval of 1 sec
/*uint8_t font[CHARACTER][ROW] = {
{0x00, 0x7e, 0x81, 0x81, 0x81, 0x81, 0x7e, 0x00},
{0x80, 0x80, 0x80, 0xff, 0x82, 0x84, 0x80, 0x00},
{0x00, 0x00, 0x8F, 0x89, 0x89, 0x89, 0xFB, 0x00},
{0x00, 0x71, 0x8b, 0x8d, 0x89, 0x89, 0xc1, 0x00},
{0x20, 0x20, 0xff, 0x22, 0x24, 0x28, 0x30, 0x00}
};*/
void setup(){
volatile char *dir_A=0x21 , *dir_B=0x24;
*dir_A = 0xff, *dir_B = 0xff;
}
void loop(){
for(int i=0; i<CHARACTER; i++){
volatile long start = millis();
while(millis()-start < DELAY){
for(int j=0; j<ROW; j++){
pulse(~(1<<j), font[i][j]);
}
}
}
}