Sign up ×
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It's 100% free, no registration required.
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

share|improve this question
3  
By deleting the other question you've deleted every comment everyone told you to help you figure out what was wrong with your code. Which doesn't really matter all that much, since you don't seem to have read them all that well in the first place. – Ignacio Vazquez-Abrams Dec 20 '14 at 5:39
3  
Please do not delete and re-post the same question. It can result in useful information being hidden, and wastes the time of people who are kindly trying to help you. – Peter R. Bloomfield Dec 20 '14 at 12:36
    
sorry but i didn't understand? you guys told me to change number_makers cuz u guys said it only displaying (a,b,c i think) – Charan Dec 20 '14 at 14:43
    
Based on your question you deleted and reposting, it's clear that you do not understand the fundamentals of C programming or programming any language for that matter. I recommend you get a book on C programming and start from there. You seem to be completely lost. – PhillyNJ Dec 20 '14 at 16:27
    
@PhilVallone i am not using c i am using arduino – Charan Dec 20 '14 at 16:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.