Loop goes quite fast. Every time it goes around, it will display 5. Sometimes it will display the other numbers also, but it'll be too fast for you to see.
Also, each one of your if's checks for the same thing. I'm guessing that's not what you wanted.
#define TIME_BETWEEN_RUNS 1000
void Run()
{
//Take over the world
}
void Loop()
{
static unsigned long u_LastRun = 0; //Replace with millis for a evenly spaced first run.
unsigned long u_ThisCheck = millis();
//Call function every TIME_BETWEEN_RUNS milliseconds.
if( u_ThisCheck >= ( u_LastRun + TIME_BETWEEN_RUNS ) ){ //EDIT: Left out bracket
Run();
u_LastRun = u_ThisCheck;
}
//Check for button input here.
}
the 7 segment display barely flashes quickly and stops,
You are going to have to take responsibility for your own code.
The code I posted simply does what you asked with your functions. It looks like it is your function
bdisplay.displayOne(count);
Is not working correctly.
Have you tested this?
The code shows how to use the blink without delay technique which is what you were asking about.
Ads PaulS points out the:-
int n = 5000;
Will give a 5 second delay before the next change in digit.
Now what is it EXACTLY you don't understand about this technique?
You make a note of the start time and keep checking that the current time minus the start time does not exceed you interval time. When it does you do what you need to do and set a new start time. Also I would have n as a long rather than an int.
All of your cases have this code. That looks to me like the specified value will be displayed only for a very short time before it is erased. Is that what you want?
Seems to me as though you want to clear the display first (not really necessary) and then write the new value.