I want to efficiently code four 8x8 dot displays. I want each 8x8 to display a number. I have done it already, (see attachment:Juno_matrix_pro), but I was using the technique for coding a 7-segment display, which is not very efficient. That older code uses uint8_t dig[14][8] 14x8=112 bytes just for mapping the number 0-9. I want to know if there is a better way to program this clock. Any suggestion will be great. thank you in advance.
These is the new code for displaying the above image. This time I am using led[32]; 32 byte to control these led, but how do I get it to display numbers??
/*
Flyandance March 26 2017
DS1302 (RTC)
Rst= A5 D7 (D25)
I/0= A4 D6 (D24)
Sclk= A3 D5 (D23)
3 buttons >> G0, G1, G2 (26, 27, 36)
buzzer >> G3 (16)
4x 8x8 Ports A, B, C, E
common cathode Port F (Active LOW)
*/
//##########################################################
#include <DS1302.h>
DS1302 rtc(25, 24, 23);
Time t;
#include <button.h>
button ba(26);
button bb(27);
button bc(36);
//##########################################################
byte led[32]; //32x8=256
byte counter;
unsigned int t1,t2,t3,t4,t5,t6,t7,t8;
//##########################################################
void setup() {
DDRA=0xff;
DDRB=0xff;
DDRC=0xff;
DDRE=0xff;
DDRF=0xff; //Active Low
//for (byte x=0; x<32; x++) led[x]=0xff;
led[0]=0xff;
led[15]=0xff;
led[16]=0xff;
led[31]=0xff;
//PORTA=0xff;
//PORTB=0xff;
//PORTC=0xff;
//PORTE=0xff;
}
//##########################################################
void loop() {
//ba.buttonWatchbot();
//bb.buttonWatchbot();
//bc.buttonWatchbot();
//##########################################################
t1=micros();
if(t1-t2>=5){
PORTF=0xff;
PORTA=led[0+counter];
PORTB=led[8+counter];
PORTC=led[16+counter];
PORTE=led[24+counter];
PORTF=~(1<<0+counter);
counter++;
if( counter==8 ) counter=0;
t2=t1;
}
}
//##########################################################
//##########################################################
Juno_matrix_pro.ino (7.66 KB)