Releases: jit89/PicoTimer
Releases · jit89/PicoTimer
v1.0.0
🚀 PicoTimer v1.0.0 — Initial Release
I am excited to announce the first official release of PicoTimer, a high-performance, non-blocking timer library specifically engineered for the Raspberry Pi Pico (RP2040) using the Earle Philhower Arduino core.
🌟 Key Features
- Non-Blocking Logic: Eliminate
delay()from your sketches. PicoTimer uses polling to keep your main loop and UI responsive. - Dual-Core Safety: Includes
MillisTimerSafeandMicrosTimerSafeclasses. These use RP2040 hardware spinlocks (critical sections) to allow safe timer manipulation across Core 0 and Core 1. - Flexible Repeat Modes: * Infinite: Continuous background tasks.
- One-Shot: Single-use delays or alarms.
- Finite Burst: Run a specific number of times (perfect for blinking status codes).
- High Precision: Support for both millisecond (
millis) and microsecond (micros) timing functions. - Template-Based Architecture: Optimized for a small memory footprint and high execution speed.
🛠 Installation
- Download the
PicoTimer.zipfrom the Assets section below. - In your Arduino IDE, go to Sketch -> Include Library -> Add .ZIP Library...
- Select the downloaded file.
📖 Quick Example
#include <PicoTimer.h>
// Blink an LED 5 times (10 state toggles) then stop
MillisTimer warning(100, [](){
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
}, 10);
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
warning.update();
}🏗 Technical Highlights
- Overflow Safety: Uses unsigned 32-bit arithmetic to handle timer rollovers correctly without logic breaks.
- Multicore Ready: Integrated with hardware/sync.h to ensure atomic operations when timers are shared between Core 0 and Core 1.
- CI/CD Verified: All examples are automatically compiled and verified via GitHub Actions to ensure code integrity.
📄 License
Distributed under the MIT License. See LICENSE for more information.