Skip to content

Commit 328e9c1

Browse files
committed
update GitHub actions
1 parent 5e6c251 commit 328e9c1

File tree

20 files changed

+57
-27
lines changed

20 files changed

+57
-27
lines changed

.github/workflows/arduino-lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ jobs:
66
runs-on: ubuntu-latest
77
timeout-minutes: 5
88
steps:
9-
- uses: actions/checkout@v4
10-
- uses: arduino/arduino-lint-action@v1
9+
- uses: actions/checkout@v6
10+
- uses: arduino/arduino-lint-action@v2
1111
with:
1212
library-manager: update
1313
compliance: strict

.github/workflows/arduino_test_runner.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ jobs:
66
runTest:
77
runs-on: ubuntu-latest
88
timeout-minutes: 20
9-
109
steps:
11-
- uses: actions/checkout@v4
10+
- uses: actions/checkout@v6
1211
- uses: ruby/setup-ruby@v1
1312
with:
1413
ruby-version: 2.6

.github/workflows/jsoncheck.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ on:
55
paths:
66
- '**.json'
77
pull_request:
8+
paths:
9+
- '**.json'
810

911
jobs:
1012
test:
1113
runs-on: ubuntu-latest
1214
timeout-minutes: 5
1315
steps:
14-
- uses: actions/checkout@v4
16+
- uses: actions/checkout@v6
1517
- name: json-syntax-check
1618
uses: limitusus/json-syntax-check@v2
1719
with:

CHANGELOG.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,21 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/)
66
and this project adheres to [Semantic Versioning](http://semver.org/).
77

8+
## [0.3.5] - 2026-01-15
9+
- update GitHub actions
10+
- add HOURS resolution
11+
- minor edits
812

913
## [0.3.4] - 2025-03-20
1014
- add **void resume()** to replace cont()
1115
- update examples
1216
- update readme.md
1317
- minor edits
1418

15-
1619
## [0.3.3] - 2024-04-11
1720
- update GitHub actions
1821
- minor edits
1922

20-
2123
## [0.3.2] - 2023-10-18
2224
- update readme.md (badges)
2325

@@ -70,7 +72,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
7072
----
7173

7274
## [0.1.3] - 2017-07-16
73-
- TODO improved seconds - OdoMeter see below ... TODO
75+
- TODO improved seconds - OdoMeter see below ... TODO
7476

7577
## [0.1.2] - 2017-07-16
7678
- add start(days, hours, minutes, seconds) + cont() == continue countdown

CountDown.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//
22
// FILE: CountDown.cpp
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.3.4
4+
// VERSION: 0.3.5
55
// PURPOSE: CountDown library for Arduino
66
// URL: https://github.com/RobTillaart/CountDown
77

@@ -137,6 +137,9 @@ void CountDown::calcRemaining()
137137
{
138138
switch(_res)
139139
{
140+
case HOURS:
141+
t = (millis() - _startTime) / (60 * 60000UL);
142+
break;
140143
case MINUTES:
141144
t = (millis() - _startTime) / 60000UL;
142145
break;

CountDown.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
//
33
// FILE: CountDown.h
44
// AUTHOR: Rob Tillaart
5-
// VERSION: 0.3.4
5+
// VERSION: 0.3.5
66
// PURPOSE: CountDown library for Arduino
77
// URL: https://github.com/RobTillaart/CountDown
88

99

1010
#include "Arduino.h"
1111

12-
#define COUNTDOWN_LIB_VERSION (F("0.3.4"))
12+
#define COUNTDOWN_LIB_VERSION (F("0.3.5"))
1313

1414

1515
class CountDown
1616
{
1717
public:
18-
enum Resolution { MICROS = 'u', MILLIS = 'm', SECONDS = 's', MINUTES = 'M' };
18+
enum Resolution { MICROS = 'u', MILLIS = 'm', SECONDS = 's', MINUTES = 'M', HOURS = 'H' };
1919

2020
explicit CountDown(const enum Resolution res = MILLIS);
2121

@@ -28,6 +28,7 @@ class CountDown
2828
// Implicit set resolution to SECONDS.
2929
bool start(uint8_t days, uint16_t hours, uint32_t minutes, uint32_t seconds);
3030
// Implicit set resolution to MINUTES.
31+
// optional set minutes to zero for hours
3132
bool start(uint8_t days, uint16_t hours, uint32_t minutes);
3233

3334
void stop();
@@ -39,6 +40,7 @@ class CountDown
3940
bool isStopped();
4041

4142
// obsolete in future
43+
[[deprecated("Use resume()")]]
4244
void cont() { resume(); }; // replaced by resume()
4345

4446
private:

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2015-2025 Rob Tillaart
3+
Copyright (c) 2015-2026 Rob Tillaart
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,16 @@ For longer periods one could cascade CountDown objects, so when one is finished
3434
Note the CountDown object is as accurate as the underlying **millis()** or **micros()**.
3535
Interrupts etc. might cause deviations.
3636

37+
Feedback as always is welcome.
38+
3739

3840
### Related
3941

42+
- https://github.com/RobTillaart/CountDown
43+
- https://github.com/RobTillaart/dateTimeHelpers formatting date / time strings
4044
- https://github.com/RobTillaart/printHelpers
4145
- https://github.com/RobTillaart/stopWatch_RT
42-
- https://github.com/RobTillaart/CountDown
43-
- https://github.com/RobTillaart/timing wrappers around millis() and microc()
46+
- https://github.com/RobTillaart/timing wrappers around millis() and micros()
4447

4548

4649
## Interface
@@ -59,6 +62,7 @@ default to MILLIS. See table below.
5962
- **enum Resolution resolution()** return the current resolution (integer).
6063
- **char getUnits()** return the current resolution as printable char (u,m,s,M)
6164

65+
6266
### Start / Stop functions
6367

6468
- **bool start(uint32_t ticks)** (re)start in current resolution.
@@ -78,12 +82,14 @@ Obsolete in future (0.4.0).
7882
- **void cont()** resumes / continue the count down.
7983
*(note continue is a C-Keyword)*
8084

85+
8186
### Status
8287

8388
- **uint32_t remaining()** returns the remaining ticks in current resolution.
8489
- **bool isRunning()** idem.
8590
- **bool isStopped()** idem.
8691

92+
8793
## Operation
8894

8995
The function **start(days, hours, minutes, seconds)** allows all combinations
@@ -118,6 +124,7 @@ The resolution is implicitly set to **CountDown::MINUTES**.
118124
| start(ticks) | MICROS = micros | ~70 min | setResolution(CountDown::MICROS) |
119125
| start(ticks) | SECONDS = millis | 49+ days | setResolution(CountDown::SECONDS) |
120126
| start(ticks) | MINUTES = millis | 49+ days | setResolution(CountDown::MINUTES) |
127+
| start(ticks) | HOURS = millis | 49+ days | setResolution(CountDown::HOURS) |
121128

122129

123130
The Countdown clock uses by default **millis()** to do the time keeping,
@@ -131,6 +138,7 @@ The parameter **res** can be:
131138
| CountDown::MILLIS | millis() | m | default
132139
| CountDown::SECONDS | millis() | s |
133140
| CountDown::MINUTES | millis() | M |
141+
| CountDown::HOURS | millis() | H |
134142

135143
Although possible one should not change the resolution of the CountDown
136144
clock while it is running as you mix up different timescales.
@@ -173,10 +181,12 @@ a repeating (timed) function or a watchdog. See examples.
173181
- add examples
174182
- visualisations - hexadecimal - alphabetical (radix 26)
175183
- depends on sensor
176-
- add resolution::HOURS + **start(days, hours)**
177-
- extend adaptive display example
178-
- or default 00 minutes?
179-
- add **void resume()** instead of **cont()**?
184+
- implement a CountDown64 class
185+
- far longer timespan
186+
- inaccurate at best
187+
- interesting for longer micros() time span?
188+
- implement a CountDownRTC class
189+
- which RTC?
180190

181191
#### Wont (unless)
182192

@@ -196,6 +206,7 @@ a repeating (timed) function or a watchdog. See examples.
196206
- printable interface (stopwatch_rt)
197207
- add call-back function when **0** is reached
198208
- cannot be guaranteed as interface polls.
209+
- enum State { RUNNING, PAUSED, STOPPED }; // stopped => remaining = 0;
199210

200211

201212
## Support

examples/countdown_DHMS/countdown_DHMS.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ void setup()
1515
{
1616
// while(!Serial); // uncomment if needed
1717
Serial.begin(115200);
18+
Serial.println();
1819
Serial.println(__FILE__);
1920
Serial.print("COUNTDOWN_LIB_VERSION: ");
2021
Serial.println(COUNTDOWN_LIB_VERSION);

examples/countdown_adaptive_display/countdown_adaptive_display.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ void setup()
1717
{
1818
// while(!Serial); // uncomment if needed
1919
Serial.begin(115200);
20+
Serial.println();
2021
Serial.println(__FILE__);
2122
Serial.print("COUNTDOWN_LIB_VERSION: ");
2223
Serial.println(COUNTDOWN_LIB_VERSION);

0 commit comments

Comments
 (0)