Skip to content

Commit

Permalink
update readme.md (#16)
Browse files Browse the repository at this point in the history
- update readme.md (badges)
  • Loading branch information
RobTillaart authored Oct 19, 2023
1 parent 69eedf0 commit 7105d5c
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 25 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [0.3.2] - 2023-10-18
- update readme.md (badges)


## [0.3.1] - 2023-03-14
- fix #14 add **restart()** function.
- add demo for restart **countdown_restart.ino**


## [0.3.0] - 2023-01-10
- fix #12 MINUTES bug
- label enum resolution to be printable u, m, s, M.
Expand Down
6 changes: 3 additions & 3 deletions CountDown.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// FILE: CountDown.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.3.1
// VERSION: 0.3.2
// PURPOSE: CountDown library for Arduino
// URL: https://github.com/RobTillaart/CountDown

Expand All @@ -11,11 +11,11 @@

CountDown::CountDown(const enum Resolution res)
{
// _res = MILLIS; // set in setResolution
// _ticks = 0; // set in setResolution
_state = CountDown::STOPPED;
_remaining = 0;
_startTime = 0;
// _res = MILLIS; // set in setResolution
// _ticks = 0; // set in setResolution
setResolution(res);
stop();
}
Expand Down
4 changes: 2 additions & 2 deletions CountDown.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
//
// FILE: CountDown.h
// AUTHOR: Rob Tillaart
// VERSION: 0.3.1
// VERSION: 0.3.2
// PURPOSE: CountDown library for Arduino
// URL: https://github.com/RobTillaart/CountDown


#include "Arduino.h"

#define COUNTDOWN_LIB_VERSION (F("0.3.1"))
#define COUNTDOWN_LIB_VERSION (F("0.3.2"))


class CountDown
Expand Down
45 changes: 29 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@
[![Arduino CI](https://github.com/RobTillaart/CountDown/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
[![Arduino-lint](https://github.com/RobTillaart/CountDown/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/CountDown/actions/workflows/arduino-lint.yml)
[![JSON check](https://github.com/RobTillaart/CountDown/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/CountDown/actions/workflows/jsoncheck.yml)
[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/CountDown.svg)](https://github.com/RobTillaart/CountDown/issues)

[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/CountDown/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/RobTillaart/CountDown.svg?maxAge=3600)](https://github.com/RobTillaart/CountDown/releases)
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/CountDown.svg)](https://registry.platformio.org/libraries/robtillaart/CountDown)


# CountDown

Arduino Library to implement a CountDown clock (in SW polling, no HW timer).
Arduino Library to implement a CountDown clock (in software polling, no hardware timer).


## Description
Expand All @@ -23,12 +26,12 @@ of 4294 seconds in micros (1h 10m) or about 49+ days when using milliseconds.
For longer periods one could cascade countDown objects, so when one is finished the next one starts.

Note the countdown object is as accurate as the underlying **millis()** or **micros()**.
Interrupts etc might cause deviations.
Interrupts etc. might cause deviations.


#### Links
#### Related

Relates to - https://github.com/RobTillaart/StopWatch_RT
- https://github.com/RobTillaart/StopWatch_RT


## Interface
Expand Down Expand Up @@ -91,14 +94,14 @@ It also uses **millis()** under the hood.
The resolution is implicitly set to **CountDown::MINUTES**.


| Call to start() | resolution | max time | comments |
|:-------------------------------------|:-----------------|:--------:|:---------|
| start(days, hours, minutes, seconds) | SECONDS = millis | 49+ days | |
| start(days, hours, minutes) | MINUTES = millis | 49+ days | |
| start(ticks) | MILLIS = millis | 49+ days | default |
| start(ticks) | MICROS = micros | ~70 min | setResolution(CountDown::MICROS) |
| start(ticks) | SECONDS = millis | 49+ days | setResolution(CountDown::SECONDS) |
| start(ticks) | MINUTES = millis | 49+ days | setResolution(CountDown::MINUTES) |
| Call to start() | resolution | max time | comments |
|:---------------------------------------|:-------------------|:----------:|:-----------|
| start(days, hours, minutes, seconds) | SECONDS = millis | 49+ days | |
| start(days, hours, minutes) | MINUTES = millis | 49+ days | |
| start(ticks) | MILLIS = millis | 49+ days | default |
| start(ticks) | MICROS = micros | ~70 min | setResolution(CountDown::MICROS) |
| start(ticks) | SECONDS = millis | 49+ days | setResolution(CountDown::SECONDS) |
| start(ticks) | MINUTES = millis | 49+ days | setResolution(CountDown::MINUTES) |


The Countdown clock uses by default **millis()** to do the time keeping,
Expand Down Expand Up @@ -141,14 +144,14 @@ a repeating (timed) function or a watchdog. See examples.

## Future

#### must
#### Must

- documentation

#### should
#### Should


#### could
#### Could

- does **restart()** need to return some information? what?
- add examples
Expand All @@ -159,7 +162,7 @@ a repeating (timed) function or a watchdog. See examples.
- or default 00 minutes?


#### wont (unless)
#### Wont (unless)

- if counting MINUTES and reaching 1 MINUTES and automatic
change to SECONDS could be NICE
Expand All @@ -177,3 +180,13 @@ a repeating (timed) function or a watchdog. See examples.
- printable interface (stopwatch_rt)
- add call-back function when **0** is reached
- cannot be guaranteed as interface polls.


## Support

If you appreciate my libraries, you can support the development and maintenance.
Improve the quality of the libraries by providing issues and Pull Requests, or
donate through PayPal or GitHub sponsors.

Thank you,

4 changes: 2 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"type": "git",
"url": "https://github.com/RobTillaart/CountDown.git"
},
"version": "0.3.1",
"version": "0.3.2",
"license": "MIT",
"frameworks": "arduino",
"frameworks": "*",
"platforms": "*",
"headers": "CountDown.h"
}
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=CountDown
version=0.3.1
version=0.3.2
author=Rob Tillaart <[email protected]>
maintainer=Rob Tillaart <[email protected]>
sentence=Arduino library to implement a CountDown clock in SW.
Expand Down

0 comments on commit 7105d5c

Please sign in to comment.