/*
Wokwi | questions
Help my project
Sensei_Markus - Wednesday, April 1, 2026 10:55 AM
Can someone help me with my project?
A 60 second countdown timer with Start/Stop and Reset buttons.
A ball going into any of 5 targets increments the score.
Written for common cathode displays.
In a real circuit the grey common pins should drive transistors
*/
const uint8_t MAX_DIGITS = 4;
const uint8_t NUM_BTNS = 7;
const uint8_t BTN_PINS[] = {12, 10, 8, 6, 4, 14, 15};
const uint8_t LED_PINS[] = {11, 9, 7, 5, 3};
const uint8_t DIG_PINS[] = {45, 43, 41, 39};
const uint8_t SEG_PINS[] = {23, 25, 27, 29, 31, 33, 35, 37}; // a - g, dp
// lookup table, which segments are on for each value
const uint8_t DIG_BITS[] = {
0xFC, // 0
0x60, // 1
0xDA, // 2
0xF2, // 3
0x66, // 4
0xB6, // 5
0xBE, // 6
0xE0, // 7
0xFE, // 8
0xF6, // 9
0x00 // blank
};
const unsigned long INTERVAL = 1000;
const int COUNT_START = 60;
void setup() {
Serial.begin(115200);
}
void loop() {
}
TIME
SCORE
Start
Reset