Countdown timer while button is held


I’m very new to coding and am working on what seems to be a simple project but i’m having trouble.

What i would like is to have a 4 digit 7 seg display be populated with a number is that user defined. Then i need that number to count to zero only if a button is being held (switch is closed). I’ve got the basic principal working but i’m using my “number” - millis() which i know uses the time since program started making it wrong already.

I’ve looked at other timers and counters but none seem to accomplish the task I need. I also tried the decrement but wans’t able to get it working. Any help is appreciated.

I’m interfacing it with MegunoLink which is what sends my number to the display. My code is below, forgive the noob code;

#include “SevSeg.h”
#include “MegunoLink.h”
#include “CommandHandler.h”

SevSeg sevseg;
CommandHandler<> SerialCommandHandler;

int FuelNumber = 0000.0000;
int p = digitalRead(A3);

void Cmd_SetFuelNumber(CommandParameter &Parameters)

void Cmd_ResetFuelNumber(CommandParameter &Parameters)

void setup() {

Serial.begin(115200); //begin serial comms
Serial.println(" Welcome To Fuel Number Display “);
Serial.println(” Code v1.1 “);
Serial.println(” Display v1.1 “);

SerialCommandHandler.AddCommand(F(“SetFuelNumber”), Cmd_SetFuelNumber);
SerialCommandHandler.AddCommand(F(“ResetFuelNumber”), Cmd_ResetFuelNumber);

byte numDigits = 4;
byte digitPins = {9, 10, 11, 12};
byte segmentPins = {2, 3, 4, 5, 6, 7, 8, 13};

bool resistorsOnSegments = true;
bool updateWithDelaysIn = true;
byte hardwareConfig = COMMON_CATHODE;
sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments);


void loop() {
// put your main code here, to run repeatedly:

int p = digitalRead(A3);

if (p == HIGH)

sevseg.setNumber(FuelNumber - (millis()/10), 2);