7 segment refresh

probably very stupid :smiley: but been looking for the problem for quite some time now (only 3 days :-X) so hopefully someone can help me.

All i’m trying to do is to display some numbers on a 7 segment display using a 595 shift register as the example on the arduino site explains very good. The problem now is, that the display won’t update, until I reset the board (or close and reopen the serial connection). The displayed numbers are then corresponding to the numbers displayed earlier on the serial connection screen.

So how do I get the display to update while the arduino is running in stead of after a reset…??

in the code what i do is:

I’m simply putting 10 hex. numbers in an array for display use with a 7 segment display:

byte number[10] = {B11100111, B00100001, B11001011, B01101011, B00101101, B01101110, B11101100, B00100011, B11101111, B00101111};

then I get the number I want with the use of a different number:

 i = (int)(value1 % 10L);               
      j = (int)(value2 / 100L);

and finally I tell the 595 to show the value (just as in the example)(i use 2 displays as one can see below)

                      digitalWrite(latchPin, LOW);
                      shiftOut(dataPin, clockPin, LSBFIRST, number[i]);
                      shiftOut(dataPin, clockPin, LSBFIRST, number[j]);       
                      //return the latch pin high to signal chip that it 
                      //no longer needs to listen for information
                      digitalWrite(latchPin, HIGH);

any code missing to get instant display of the numbers??

Posting a link to the whole code or including it here would help. What you posted seems OK.

thanks for your reply, I’ll clean up my code to make it readable for others and post it soon :stuck_out_tongue:

or do I also need a

void shiftout()

part in my code? Don’t have that one at the moment… But the code is correctly sent to the 595’s since it is displayed after a reset!

I’m pretty sure if you needed a shiftout function and didn’t have it the compiler would complain.

well, works now :o

maybe just a lose wire but checked em all before… :stuck_out_tongue: changed nothing in the code though, so a bit strange