Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ body:
id: version
attributes:
label: Library version
placeholder: 1.0.0
placeholder: 1.0.3
validations:
required: true
- type: input
Expand Down
4 changes: 2 additions & 2 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"creators": [{"name": "@dev.mako (devkyato)", "affiliation": "MATA Company"}],
"contributors": [{"name": "Cursor Agent", "type": "Other"}],
"title": "ArduinoPatterns: non-blocking LED and digital-output patterns for Arduino",
"description": "<h2>Overview</h2><p>ArduinoPatterns is a compact teaching and prototyping library for coordinating LEDs and other digital outputs without blocking the main loop.</p><h2>Capabilities</h2><ul><li><strong>LedBank</strong> maps up to 32 pins to a bit mask.</li><li><strong>LedAnimator</strong> plays rollover-safe timed sequences with <code>millis()</code>.</li><li><strong>PeriodicOutput</strong> toggles independent outputs at separate rates.</li><li>The implementation uses no heap allocation, interrupts, third-party dependencies, or board-specific APIs.</li></ul><h2>Installation</h2><p>Download the release ZIP and use Arduino IDE <strong>Sketch &gt; Include Library &gt; Add .ZIP Library</strong>, or add <code>https://github.com/devkyato/Custom-Arduino-Libraries.git#v1.0.2</code> to PlatformIO <code>lib_deps</code>.</p><h2>Quick start</h2><pre><code>#include &lt;ArduinoPatterns.h&gt;\nconst uint8_t pins[] = {6, 7, 8};\nconst PatternStep steps[] = {{0b001, 5000}, {0b010, 2000}, {0b100, 5000}};\nLedBank lights(pins, 3);\nLedAnimator traffic(lights, steps, 3);\nvoid setup() { lights.begin(); traffic.start(millis()); }\nvoid loop() { traffic.update(millis()); }</code></pre><h2>Applications</h2><ul><li>Traffic lights, scanners, counters, status indicators, and active-low modules.</li><li>Lessons on bit masks, elapsed-time scheduling, and cooperative state machines.</li><li>Responsive sketches that continue reading sensors, buttons, serial, or network input.</li></ul><h2>Compatibility, safety, and limitations</h2><p>The API uses standard Arduino digital I/O and unsigned millisecond arithmetic. CI compile coverage is not hardware validation. GPIO current and voltage limits still apply; use resistors and appropriate drivers for loads. A bank is limited to 32 outputs, callers retain ownership of pin and step arrays, and a zero interval disables periodic toggling.</p><h2>Documentation</h2><ul><li><a href=\"https://github.com/devkyato/Custom-Arduino-Libraries#readme\">Showcase and examples gallery</a></li><li><a href=\"https://github.com/devkyato/Custom-Arduino-Libraries/blob/main/docs/API.md\">API reference</a></li></ul><h2>Related software</h2><p><a href=\"https://github.com/devkyato/Arduino-Programs-Guide\">Arduino Programs Guide</a> is the companion course and introduces the progression that this library generalizes from Exercise B onward.</p><h2>Citation</h2><p>@dev.mako (devkyato). (2026). <strong>ArduinoPatterns: non-blocking LED and digital-output patterns for Arduino</strong> (Version 1.0.2). Zenodo. <a href=\"https://doi.org/10.5281/zenodo.21853284\">https://doi.org/10.5281/zenodo.21853284</a></p>",
"version": "1.0.2",
"description": "<h2>Overview</h2><p>ArduinoPatterns is a compact teaching and prototyping library for coordinating LEDs and other digital outputs without blocking the main loop.</p><h2>Capabilities</h2><ul><li><strong>LedBank</strong> maps up to 32 pins to a bit mask.</li><li><strong>LedAnimator</strong> plays rollover-safe timed sequences with <code>millis()</code>.</li><li><strong>PeriodicOutput</strong> toggles independent outputs at separate rates.</li><li>The implementation uses no heap allocation, interrupts, third-party dependencies, or board-specific APIs.</li></ul><h2>Installation</h2><p>Download the release ZIP and use Arduino IDE <strong>Sketch &gt; Include Library &gt; Add .ZIP Library</strong>, or add <code>https://github.com/devkyato/Custom-Arduino-Libraries.git#v1.0.3</code> to PlatformIO <code>lib_deps</code>.</p><h2>Quick start</h2><pre><code>#include &lt;ArduinoPatterns.h&gt;\nconst uint8_t pins[] = {6, 7, 8};\nconst PatternStep steps[] = {{0b001, 5000}, {0b010, 2000}, {0b100, 5000}};\nLedBank lights(pins, 3);\nLedAnimator traffic(lights, steps, 3);\nvoid setup() { lights.begin(); traffic.start(millis()); }\nvoid loop() { traffic.update(millis()); }</code></pre><h2>Applications</h2><ul><li>Traffic lights, scanners, counters, status indicators, and active-low modules.</li><li>Lessons on bit masks, elapsed-time scheduling, and cooperative state machines.</li><li>Responsive sketches that continue reading sensors, buttons, serial, or network input.</li></ul><h2>Compatibility, safety, and limitations</h2><p>The API uses standard Arduino digital I/O and unsigned millisecond arithmetic. CI compile coverage is not hardware validation. GPIO current and voltage limits still apply; use resistors and appropriate drivers for loads. A bank is limited to 32 outputs, callers retain ownership of pin and step arrays, and a zero interval disables periodic toggling.</p><h2>Documentation</h2><ul><li><a href=\"https://github.com/devkyato/Custom-Arduino-Libraries#readme\">Showcase and examples gallery</a></li><li><a href=\"https://github.com/devkyato/Custom-Arduino-Libraries/blob/main/docs/API.md\">API reference</a></li></ul><h2>Related software</h2><p><a href=\"https://github.com/devkyato/Arduino-Programs-Guide\">Arduino Programs Guide</a> is the companion course and introduces the progression that this library generalizes from Exercise B onward.</p><h2>Citation</h2><p>@dev.mako (devkyato). (2026). <strong>ArduinoPatterns: non-blocking LED and digital-output patterns for Arduino</strong> (Version 1.0.3). Zenodo. <a href=\"https://doi.org/10.5281/zenodo.21853284\">https://doi.org/10.5281/zenodo.21853284</a></p>",
"version": "1.0.3",
"keywords": ["Arduino", "LED", "digital output", "non-blocking", "millis", "state machine", "library", "education", "ESP32", "RP2040"],
"license": "mit",
"upload_type": "software",
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@
All notable changes to ArduinoPatterns are documented here. The project follows
[Semantic Versioning](https://semver.org/).

## [Unreleased]

## [1.0.3] - 2026-08-12

### Added

- Add a `ButtonPause` example showing non-blocking pause/resume with `stop()` and `start()`.

### Fixed

- Update the bug-report template placeholder to 1.0.2.

## [1.0.2] - 2026-08-09

### Changed
Expand Down Expand Up @@ -41,4 +53,5 @@ All notable changes to ArduinoPatterns are documented here. The project follows

[1.0.0]: https://github.com/devkyato/Custom-Arduino-Libraries/releases/tag/v1.0.0
[1.0.1]: https://github.com/devkyato/Custom-Arduino-Libraries/compare/v1.0.0...v1.0.1
[1.0.3]: https://github.com/devkyato/Custom-Arduino-Libraries/compare/v1.0.2...v1.0.3
[1.0.2]: https://github.com/devkyato/Custom-Arduino-Libraries/compare/v1.0.1...v1.0.2
8 changes: 4 additions & 4 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ title: "ArduinoPatterns: non-blocking LED and digital-output patterns for Arduin
authors:
- name: "@dev.mako (devkyato)"
affiliation: "MATA Company"
version: 1.0.2
date-released: 2026-08-09
version: 1.0.3
date-released: 2026-08-12
license: MIT
repository-code: "https://github.com/devkyato/Custom-Arduino-Libraries"
url: "https://github.com/devkyato/Custom-Arduino-Libraries"
Expand Down Expand Up @@ -36,8 +36,8 @@ preferred-citation:
authors:
- name: "@dev.mako (devkyato)"
affiliation: "MATA Company"
version: 1.0.2
date-released: 2026-08-09
version: 1.0.3
date-released: 2026-08-12
repository-code: "https://github.com/devkyato/Custom-Arduino-Libraries"
doi: 10.5281/zenodo.21853284
license: MIT
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.21853284.svg)](https://doi.org/10.5281/zenodo.21853284)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

ArduinoPatterns 1.0.2 is a focused Arduino library for coordinating LEDs and
ArduinoPatterns 1.0.3 is a focused Arduino library for coordinating LEDs and
other digital outputs without blocking `loop()`. It packages common teaching
patterns into reusable components that can run alongside buttons, sensors,
serial communication, displays, or networking.
Expand All @@ -15,8 +15,8 @@ serial communication, displays, or networking.
- `LedAnimator`: play timed mask sequences using rollover-safe `millis()` logic.
- `PeriodicOutput`: blink independent outputs at different rates.
- No heap allocation, third-party dependencies, interrupts, or board-specific API.
- Six compile-checked examples spanning traffic lights, scanners, counters,
alternating masks, and independent blinkers.
- Seven compile-checked examples spanning traffic lights, scanners, counters,
alternating masks, independent blinkers, and button pause/resume.

## Installation

Expand All @@ -25,7 +25,7 @@ Library** in Arduino IDE. In PlatformIO:

```ini
lib_deps =
https://github.com/devkyato/Custom-Arduino-Libraries.git#v1.0.2
https://github.com/devkyato/Custom-Arduino-Libraries.git#v1.0.3
```

To work from source, clone the repository into the Arduino `libraries` folder or
Expand Down Expand Up @@ -70,6 +70,7 @@ responsive.
| [BinaryCounter](examples/BinaryCounter/BinaryCounter.ino) | direct `LedBank` masks and rollover-safe timing | arrays, bit masks, and output mapping |
| [CountUpDown](examples/CountUpDown/CountUpDown.ino) | longer repeating animation tables | progression toward state-machine lessons |
| [IndependentBlink](examples/IndependentBlink/IndependentBlink.ino) | two concurrent periodic outputs | cooperative scheduling used throughout Exercises C–F |
| [ButtonPause](examples/ButtonPause/ButtonPause.ino) | pause and resume with `stop()` / `start()` | interactive control without blocking `loop()` |

These examples are maintained adaptations of concepts present in the repository's
earlier laboratory sketches; they are not claimed as unchanged originals. Git
Expand Down Expand Up @@ -107,15 +108,15 @@ architectures may work but are unverified.
- [Examples gallery](#examples-gallery) — working sketches mapped to concepts.
- [Contributing guide](CONTRIBUTING.md) — development and test expectations.
- [Security policy](SECURITY.md) — supported release and reporting process.
- [Changelog](CHANGELOG.md) and [1.0.2 release notes](RELEASE_NOTES.md).
- [Changelog](CHANGELOG.md) and [1.0.3 release notes](RELEASE_NOTES.md).

## Citation

If you use this software in research or teaching, cite the archived release when
available, or use:

```text
@dev.mako (devkyato). (2026). ArduinoPatterns: non-blocking LED and digital-output patterns for Arduino (Version 1.0.2). Zenodo. https://doi.org/10.5281/zenodo.21853284
@dev.mako (devkyato). (2026). ArduinoPatterns: non-blocking LED and digital-output patterns for Arduino (Version 1.0.3). Zenodo. https://doi.org/10.5281/zenodo.21853284
```

See [CITATION.cff](CITATION.cff) for machine-readable metadata.
Expand Down
16 changes: 6 additions & 10 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
# ArduinoPatterns 1.0.2
# ArduinoPatterns 1.0.3

Publication and documentation quality release for Zenodo archival presentation.
Patch release: ButtonPause example and bug-template version fix.

## Highlights

- Expand README installation, applications, limitations, documentation index, and citation guidance.
- Add an examples gallery that maps each sketch to concepts and the companion Arduino Programs Guide.
- Package `docs/API.md`, `CITATION.cff`, release notes, and governance files in the Arduino IDE ZIP.
- Align metadata attribution on `@dev.mako (devkyato)` and validate release metadata before packaging.
- Compile every example across Uno, ESP32, and RP2040 CI targets.
- Add a `ButtonPause` example showing non-blocking pause/resume with `stop()` and `start()`.
- Update the bug-report template placeholder to the current release version.

## Install

Arduino IDE: download `ArduinoPatterns-1.0.2.zip` and choose **Sketch > Include Library > Add .ZIP Library**.
Arduino IDE: download `ArduinoPatterns-1.0.3.zip` and choose **Sketch > Include Library > Add .ZIP Library**.

PlatformIO:

```ini
lib_deps =
https://github.com/devkyato/Custom-Arduino-Libraries.git#v1.0.2
https://github.com/devkyato/Custom-Arduino-Libraries.git#v1.0.3
```

## Citation
Expand All @@ -28,4 +25,3 @@ Concept DOI: https://doi.org/10.5281/zenodo.21853284
See `CITATION.cff` for machine-readable citation metadata.

Published by @dev.mako (devkyato). Cursor Agent is acknowledged as a non-author contributor.

39 changes: 39 additions & 0 deletions examples/ButtonPause/ButtonPause.ino
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#include <ArduinoPatterns.h>

// Pause and resume a scanning animation with a momentary button on pin 2.
// The button uses INPUT_PULLUP; press to ground.

const uint8_t pins[] = {6, 7, 8, 9};
const PatternStep steps[] = {
{0b0001, 120},
{0b0010, 120},
{0b0100, 120},
{0b1000, 120},
{0b0100, 120},
{0b0010, 120},
};

LedBank lights(pins, 4);
LedAnimator scanner(lights, steps, 6);
const uint8_t kPauseButton = 2;
bool previousPressed = false;

void setup() {
pinMode(kPauseButton, INPUT_PULLUP);
lights.begin();
scanner.start(millis());
}

void loop() {
const uint32_t now = millis();
const bool pressed = digitalRead(kPauseButton) == LOW;
if (pressed && !previousPressed) {
if (scanner.running()) {
scanner.stop(false);
} else {
scanner.start(now);
}
}
previousPressed = pressed;
scanner.update(now);
}
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ArduinoPatterns",
"version": "1.0.2",
"version": "1.0.3",
"description": "Rollover-safe, non-blocking LED and digital-output patterns for Arduino without interrupts or heap allocation.",
"keywords": ["arduino", "led", "digital-output", "non-blocking", "millis", "state-machine", "education"],
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=ArduinoPatterns
version=1.0.2
version=1.0.3
author=@dev.mako (devkyato) and contributors
maintainer=@dev.mako (devkyato)
sentence=Non-blocking LED and digital-output patterns for Arduino.
Expand Down
2 changes: 1 addition & 1 deletion tools/validate_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def main() -> None:
cff = (ROOT / "CITATION.cff").read_text(encoding="utf-8")
readme = (ROOT / "README.md").read_text(encoding="utf-8")

assert version == "1.0.2"
assert version == "1.0.3"
assert zenodo["version"] == version
assert library_json["version"] == version
assert re.search(rf"^version: {re.escape(version)}$", cff, re.MULTILINE)
Expand Down