4 digit segment display with backpack Adafruit ref. ADA881

Hello friends, Who can and will help a new Arduino UNO user? I would be very glad with your help to find out what I am missing and what I am doing wrong.
I soldered the seven seg.display with backpack (ADA881), uploaded the code. (Count down in sec.) All OK, looks nice!!
Afther searching all possible info, I still can’t find out:
1// The few lines of code to add for the two dots between minutes and seconds. The first two digits (left side) are for the minutes, the last two (right side) are for the seconds. So I would like the two dots in the middle ON. Afther a lot of tests, I ended by this 2 extra lines of code :
void loop() {
matrix.writeDigitRaw(2,(0x02));
matrix.writeDisplay(); …
Probably this is wrong or misplaced by me.
2// How to hook up a push button to stop count down and reset to start countdown.
3// The code when using that push button.

/***********************************************
* Count down using millis()
*
* Adafruit 7-segment, I2C, LED backpack display
*
* pin A5 -> C (on 7-segment)
* pin A4 -> D (on 7-segment)
*
************************************************/

#include <Wire.h>
#include "Adafruit_GFX.h"
#include "Adafruit_LEDBackpack.h"
Adafruit_7segment matrix = Adafruit_7segment();

unsigned long previousSecondMillis = 0UL;
long oneSecond = 1000UL; // milliseconds per second

#define startMinute 4  //  Modify these defines to
#define startSecond 00 // change the timer interval
int minutes = startMinute;
int seconds = startSecond;

void setup()
{
  matrix.begin(0x70);

  

}

void loop() {

   matrix.writeDigitRaw(2,(0x02));
   matrix.writeDisplay();

  // --------- Run this every second ------------------
  if (millis() - previousSecondMillis >= oneSecond) {
    matrix.writeDigitNum(0, (minutes / 10));
    matrix.writeDigitNum(1, (minutes % 10));
    matrix.writeDigitNum(3, (seconds / 10));
    matrix.writeDigitNum(4, (seconds % 10));
    matrix.writeDisplay();

    if (seconds-- == 0) {
      if (minutes == 0) {
        minutes = startMinute;
        seconds = startSecond;
        delay(1000);
      } else {
        minutes -= 1;
        seconds = 59;
      }
    }

    previousSecondMillis += oneSecond;
  }
}

Many thanks for your help friends!!!
Kind regards, Michel

Look in the Adafruit library for use of "drawColon()": /examples/clock_sevenseg_ds1307/clock_sevenseg_ds1307.ino

2// How to hook up a push button to stop count down and reset to start countdown.

There are two or more parts to that question.

Hardware setup: https://www.arduino.cc/en/Tutorial/Button

Reading the switch, and determine when it has become pressed (or released) is illustrated in the state change detection example.

Debouncing the switch is (piss-poorly) illustrated here: https://www.arduino.cc/en/Tutorial/Debounce I say piss-poorly because the switch either is in the same state as it was last time, and hasn't bounced, or it isn't. There are only TWO variables needed to determine that, not the three that the stupid example uses.

If the state HAS changed, the change might be important, and the previous state should be set to the current state, or it might not be, in which case the previous state doesn't change and the change is ignored. What makes it important, or not, is how long ago the previous change happened.

When a change (an important one) happens, toggle a flag, countingDown (it is was true, make it false; if it was false, make it true).

Independently of the switch, count down the time if countingDown is true. Do nothing if it isn't.

Look in the Adafruit library for use of "drawColon()": /examples/clock_sevenseg_ds1307/clock_sevenseg_ds1307.ino

Edgemoron, Thank you for your reply. I did a lot of tests and finally found out that the middle dots must be dead. Maybe when soledering it went to hot. So afther that I tried to use the middle lower dot. I found the code, so this is working fine. Lets say I am happy for 90%. :-) Anyway, thanks a lot for your time.Kind regards, Michel

PaulS:
There are two or more parts to that question.

Hardware setup:
https://www.arduino.cc/en/Tutorial/Button

Reading the switch, and determine when it has become pressed (or released) is illustrated in the state change detection example.

Debouncing the switch is (piss-poorly) illustrated here:
https://www.arduino.cc/en/Tutorial/Debounce
I say piss-poorly because the switch either is in the same state as it was last time, and hasn’t bounced, or it isn’t. There are only TWO variables needed to determine that, not the three that the stupid example uses.

If the state HAS changed, the change might be important, and the previous state should be set to the current state, or it might not be, in which case the previous state doesn’t change and the change is ignored. What makes it important, or not, is how long ago the previous change happened.

When a change (an important one) happens, toggle a flag, countingDown (it is was true, make it false; if it was false, make it true).

Independently of the switch, count down the time if countingDown is true. Do nothing if it isn’t.

Hello PaulS, thank you for your reply. It means a lot to me. The dots are OK now (more or less) the next step is te button. For me… it will be like (almost) hell. I was looking about your info. What I want to do is: Push the button, the countdown starts from p.e. 5min to zero, pusch again, the countdown stops, push again the countdown resets to 5 min., push again the countdown starts from 5min to zero sec. So for me, I need wiring and code. At this moment the code looks like this:

*************************************************** 
  This is a library for our I2C LED Backpacks

  Designed specifically to work with the Adafruit LED 7-Segment backpacks 
  ----> http://www.adafruit.com/products/881
  ----> http://www.adafruit.com/products/880
  ----> http://www.adafruit.com/products/879
  ----> http://www.adafruit.com/products/878

  These displays use I2C to communicate, 2 pins are required to 
  interface. There are multiple selectable I2C addresses. For backpacks
  with 2 Address Select pins: 0x70, 0x71, 0x72 or 0x73. For backpacks
  with 3 Address Select pins: 0x70 thru 0x77

  Adafruit invests time and resources providing this open source code, 
  please support Adafruit and open-source hardware by purchasing 
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.  
  BSD license, all text above must be included in any redistribution
 ****************************************************/

 
 
#include <Wire.h>
#include "Adafruit_LEDBackpack.h"
#include "Adafruit_GFX.h"
Adafruit_7segment matrix = Adafruit_7segment();

unsigned long previousSecondMillis = 0UL;
long oneSecond = 1000UL; // milliseconds per second

#define startMinute 88  //  Modify these defines to
#define startSecond 00 // change the timer interval
int minutes = startMinute;
int seconds = startSecond;




void setup() {

  Serial.begin(9600);
  Serial.println("7 Segment Backpack Test");
  matrix.begin(0x70);
}

void loop()

{
  boolean drawDots = true;
  
 
  

  // --------- Run this every second ------------------
  if (millis() - previousSecondMillis >= oneSecond) {
    
    matrix.writeDigitNum(0, (minutes / 10));
    matrix.writeDigitNum(1, (minutes % 10), (drawDots));
    matrix.writeDigitNum(3, (seconds / 10));
    matrix.writeDigitNum(4, (seconds % 10));
    matrix.writeDisplay();

    if (seconds-- == 0) {
      if (minutes == 0) {
        minutes = startMinute;
        seconds = startSecond;
        delay(1000);
      } else {
        minutes -= 1;
        seconds = 59;
      }
    }

 
  
    previousSecondMillis += oneSecond;
  }
  }

Thanks again, kind regards, Michel