Using a Sparkfun display for a counter

Hi,

I'm trying to work on a counter project that will start and 300 and will count down to zero when a button is triggered.

I'm using a COM-09766 from sparkfun for the display (although I only need 3 digits instead of 4) and running off an UNO.

Does anyone have any suggestions on how I can achieve this?

Thanks in advance Dan

Have you written some code ? Have you got an idea that we might discuss ?

No nothing yet.

I've seen some examples for using the 7 segment display to count up automatically but nothing that will count down via a manual input.

I simply want to have to counter display "300" on start up then, go down each time the button is pressed. If the button is held in for a longer time the counter will count faster.

Thanks

I would get it working in the serial monitor first then get it writing to your particular screen.
Something like this (not at all tested).

int x=300;
int Button=5;

void Setup()
 {
Serial.print(x);
digitalWrite(Button, HIGH);
}
void Loop()
{
 if(digitalRead(Button)==LOW)
{
Countdown();
}

}

void Countdown()
{

for (int i=300; i <= 0; i--){
      Serial.print(i)
       } 
}

dannyc09: No nothing yet.

I've seen some examples for using the 7 segment display to count up automatically but nothing that will count down via a manual input.

I simply want to have to counter display "300" on start up then, go down each time the button is pressed. If the button is held in for a longer time the counter will count faster.

Thanks

Pauly's suggestion about working with the serial monitor is good. Concentrate on core logic first, display issues next.

You'll need to detect button presses (debounce, state change: search the forum and the playground, lots of examples and code). You'll obviously need also to keep track of how long the button was held pressed.

I suggest you first study the blink without delay example. The technique explained there will be very useful in you project.

my 2 cents.

I've seen some examples for using the 7 segment display

That display is a serial version, so all you need to do is get the code working as has been suggested above, then instead of doing Serial.print() to output the numbers send them with either SPI or Softserial.


Rob

The display has no current limiting resistor, by the way.

Yes, the digits change brightness according the to number of segments turned on. Bit slack I think.


Rob