int dtime;
const int rows = 10;
byte numbers[rows][7] = {
{ 1,1,1,1,1,1,0},// = 0
{ 0,1,1,0,0,0,0 }, // = 1
{ 1,1,0,1,1,0,1 }, // = 2
{ 1,1,1,1,0,0,1}, // = 3
{ 0,1,1,0,0,1,1}, // = 4
{ 1,0,1,1,0,1,1}, // = 5
{ 1,0,1,1,1,1,1}, // = 6
{ 1,1,1,0,0,0,0}, // = 7
{ 1,1,1,1,1,1,1}, // = 8
{ 1,1,1,1,0,1,1 }, // = 9
};
/*
byte numbers[rows][4] = {
{ 0,0,0,0}, //0
{ 0,0,0,1}, //1
{ 0,0,1,0}, //2
{ 0,0,1,1}, //3
{ 0,1,0,0}, //4
{ 0,1,0,1}, //5
{ 0,1,1,0}, //6
{ 0,1,1,1}, //7
{ 1,0,0,0}, //8
{ 1,0,0,1}, //9
};
*/
void setup() {
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
digitalWrite(2, 1);
digitalWrite(3, 1);
digitalWrite(4, 1);
digitalWrite(5, 1);
delay(1000);
}
void numbers_maker(byte digit) {
digitalWrite(2,numbers[digit][1]);
digitalWrite(3,numbers[digit][2]);
digitalWrite(4,numbers[digit][3]);
digitalWrite(5,numbers[digit][4]);
}
void loop() {
dtime=7000 ;
for (int i=0; i<rows; i++) {
numbers_maker(i) ;
delay(dtime);
}
/*
dtime=300 ;
for (int i=4; i>=0; --i) {
numbers_maker(i) ;
delay(dtime);
}
*/
}
I am using two chips 7404 and 74ls4n, idk if i have to use BCd numbers or the one i am using. Also, i am using ports 2-5. I want to display numbers 0-9 and then 9-0