Skip to content

Commit dc7fdad

Browse files
committed
0.2.5 CountDown
1 parent 3f66f01 commit dc7fdad

File tree

13 files changed

+77
-26
lines changed

13 files changed

+77
-26
lines changed

libraries/CountDown/.arduino-ci.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ compile:
22
# Choosing to run compilation tests on 2 different Arduino platforms
33
platforms:
44
- uno
5-
- leonardo
6-
- due
7-
- zero
5+
# - due
6+
# - zero
7+
# - leonardo
8+
- m4
9+
- esp32
10+
# - esp8266
11+
# - mega2560

libraries/CountDown/.github/workflows/arduino_test_runner.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@ name: Arduino CI
44
on: [push, pull_request]
55

66
jobs:
7-
arduino_ci:
7+
runTest:
88
runs-on: ubuntu-latest
99

1010
steps:
1111
- uses: actions/checkout@v2
12-
- uses: Arduino-CI/action@master
13-
# Arduino-CI/[email protected]
12+
- uses: ruby/setup-ruby@v1
13+
with:
14+
ruby-version: 2.6
15+
- run: |
16+
gem install arduino_ci
17+
arduino_ci.rb

libraries/CountDown/CountDown.cpp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
//
22
// FILE: CountDown.cpp
33
// AUTHOR: Rob Tillaart
4-
// VERSION: 0.2.4
4+
// VERSION: 0.2.5
55
// PURPOSE: CountDown library for Arduino
66
// URL: https://github.com/RobTillaart/CountDown
77
//
88
// HISTORY:
9-
// 0.2.4 2021-01-15 start detect overflow now.
10-
// 0.2.3 2020-12-17 add arduino-ci + unit test
11-
// 0.2.2 2020-07-08 add MINUTES; refactor
12-
// 0.2.1 2020-06-05 fix library.json
13-
// 0.2.0 2020-03-29 #pragma once, removed pre 1.0 support
14-
// 0.1.3 2017-07-16 TODO improved seconds - OdoMeter see below ... TODO
15-
// 0.1.2 2017-07-16 added start(days, hours, minutes, seconds) + cont() == continue countdown
16-
// 0.1.1 2015-10-29 added start(h, m, s)
179
// 0.1.0 2015-10-27 initial version
10+
// 0.1.1 2015-10-29 added start(h, m, s)
11+
// 0.1.2 2017-07-16 added start(days, hours, minutes, seconds) + cont() == continue countdown
12+
// 0.1.3 2017-07-16 TODO improved seconds - OdoMeter see below ... TODO
13+
// 0.2.0 2020-03-29 #pragma once, removed pre 1.0 support
14+
// 0.2.1 2020-06-05 fix library.json
15+
// 0.2.2 2020-07-08 add MINUTES; refactor
16+
// 0.2.3 2020-12-17 add arduino-ci + unit test
17+
// 0.2.4 2021-01-15 start detect overflow now.
18+
// 0.2.5 2021-10-19 update Arduino-CI + badgets
1819

1920

2021
#include "CountDown.h"

libraries/CountDown/CountDown.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// FILE: CountDown.h
44
// AUTHOR: Rob Tillaart
5-
// VERSION: 0.2.4
5+
// VERSION: 0.2.5
66
// PURPOSE: CountDown library for Arduino
77
// URL: https://github.com/RobTillaart/CountDown
88
//
@@ -13,7 +13,7 @@
1313
#include "Arduino.h"
1414

1515

16-
#define COUNTDOWN_LIB_VERSION (F("0.2.4"))
16+
#define COUNTDOWN_LIB_VERSION (F("0.2.5"))
1717

1818

1919
class CountDown
@@ -49,4 +49,5 @@ class CountDown
4949
void calcRemaining();
5050
};
5151

52+
5253
// -- END OF FILE --

libraries/CountDown/README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

2-
32
[![Arduino CI](https://github.com/RobTillaart/CountDown/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
3+
[![Arduino-lint](https://github.com/RobTillaart/CountDown/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/CountDown/actions/workflows/arduino-lint.yml)
4+
[![JSON check](https://github.com/RobTillaart/CountDown/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/CountDown/actions/workflows/jsoncheck.yml)
45
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/CountDown/blob/master/LICENSE)
56
[![GitHub release](https://img.shields.io/github/release/RobTillaart/CountDown.svg?maxAge=3600)](https://github.com/RobTillaart/CountDown/releases)
67

@@ -26,9 +27,9 @@ For longer periods one could cascade countDown, so when one is finished the next
2627

2728
The main functions of the CountDown clock are:
2829

29-
- **bool start(ticks)**
30-
- **bool start(days, hours, minutes, seconds)**
31-
- **bool start(days, hours, minutes)**
30+
- **bool start(uint32_t ticks)**
31+
- **bool start(uint8_t days, uint16_t hours, uint32_t minutes, uint32_t seconds)**
32+
- **bool start(uint8_t days, uint16_t hours, uint32_t minutes)**
3233
- **void stop()**
3334
- **void cont()** *(continue is a C-Keyword)*
3435
- **uint32_t remaining()**
@@ -51,7 +52,7 @@ If there is an overflow it returns false
5152

5253
Total amount of time to countdown for **CountDown::MICROS** may not exceed 2\^32 micros ~ 1 hour 10 minutes.
5354
Total amount of time to countdown for **CountDown::MILLIS**, **CountDown::SECONDS** and **CountDown::MINUTES**
54-
may not exceed 2\^32 millis ~49 days
55+
may not exceed 2\^32 milliseconds ~49 days
5556

5657

5758
The function **start(days, hours, minutes)** is new since 0.2.2.
@@ -85,3 +86,10 @@ the user must press a button at least once per minute to show he is still
8586
awake.
8687

8788

89+
## Future
90+
91+
- incorporate a real time clock? or EEPROM to be reboot proof?
92+
- examples with visualisations (e.g. hexadecimal countdown)
93+
- Countdown based upon external pulses
94+
- uint64_t version ==> **CountDown64** class?
95+

libraries/CountDown/examples/countdown_demo1/countdown_demo1.ino

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
// https://github.com/RobTillaart/CountDown
99
//
1010

11+
1112
#include "CountDown.h"
1213

1314
CountDown CD(CountDown::MINUTES);
1415

1516
uint32_t start, stop;
1617

18+
1719
void setup()
1820
{
1921
Serial.begin(115200);
@@ -39,8 +41,11 @@ void setup()
3941
Serial.println("done...");
4042
}
4143

44+
4245
void loop()
4346
{
4447
}
4548

49+
4650
// -- END OF FILE --
51+

libraries/CountDown/examples/countdown_demo2/countdown_demo2.ino

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
// https://github.com/RobTillaart/CountDown
99
//
1010

11+
1112
#include "CountDown.h"
1213

1314
CountDown CD[5];
1415

1516
uint8_t lines = 0;
1617

18+
1719
void setup()
1820
{
1921
Serial.begin(115200);
@@ -29,6 +31,7 @@ void setup()
2931
CD[3].stop();
3032
}
3133

34+
3235
void loop()
3336
{
3437
if (lines == 10)
@@ -59,4 +62,6 @@ void loop()
5962
delay(250);
6063
}
6164

65+
6266
// -- END OF FILE --
67+

libraries/CountDown/examples/countdown_setResolution/countdown_setResolution.ino

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
// https://github.com/RobTillaart/CountDown
99
//
1010

11+
1112
#include "CountDown.h"
1213

1314
CountDown CD;
1415

16+
1517
void setup()
1618
{
1719
Serial.begin(115200);
@@ -24,6 +26,7 @@ void setup()
2426
CD.start(1);
2527
}
2628

29+
2730
void loop()
2831
{
2932
static uint32_t last_remaining = 0;
@@ -36,3 +39,7 @@ void loop()
3639
Serial.print(CD.remaining());
3740
delay(5000); // every 5 seconds
3841
}
42+
43+
44+
// -- END OF FILE --
45+

libraries/CountDown/examples/demo_DHMS/demo_DHMS.ino

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
// https://github.com/RobTillaart/CountDown
99
//
1010

11+
1112
#include "CountDown.h"
1213

1314
CountDown CD;
1415

16+
1517
void setup()
1618
{
1719
Serial.begin(115200);
@@ -23,6 +25,7 @@ void setup()
2325
CD.start(0, 0, 1, 0);
2426
}
2527

28+
2629
void loop()
2730
{
2831
static uint32_t last_remaining = 0;
@@ -34,4 +37,8 @@ void loop()
3437
Serial.print('\t');
3538
Serial.print(CD.remaining());
3639
delay(250);
37-
}
40+
}
41+
42+
43+
// -- END OF FILE --
44+

libraries/CountDown/examples/demo_continue/demo_continue.ino

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,12 @@
88
// https://github.com/RobTillaart/CountDown
99
//
1010

11+
1112
#include "CountDown.h"
1213

1314
CountDown CD[2];
1415

16+
1517
void setup()
1618
{
1719
Serial.begin(115200);
@@ -25,6 +27,7 @@ void setup()
2527
CD[1].stop();
2628
}
2729

30+
2831
void loop()
2932
{
3033
for (int i = 0; i < 2; i++)
@@ -45,4 +48,8 @@ void loop()
4548
}
4649

4750
delay(250);
48-
}
51+
}
52+
53+
54+
// -- END OF FILE --
55+

0 commit comments

Comments
 (0)