blinker

Crates.ioblinker
lib.rsblinker
version0.1.1
created_at2024-12-16 10:37:30.371955+00
updated_at2024-12-16 11:33:06.702245+00
descriptioneasily creating async blinky programs for embedded systems
homepage
repositoryhttps://github.com/Dicklessgreat/blinker
max_upload_size
id1484853
size10,812
Dickless (Dicklessgreat)

documentation

README

Blinker

A no_std led blinking library for embedded systems.

Features

  • Async/await support
  • Configurable blink patterns through Schedule
  • Support for both finite and infinite blinking sequences
  • No heap allocation (uses heapless Vec)
use blinker::{Blinker, Schedule};
use embassy_time::Duration;
use embedded_hal::digital::StatefulOutputPin;

async fn blink_task(led_pin: impl StatefulOutputPin) {
    let mut blinker = Blinker::<_, 1>::new(led_pin);
    // Blink with 500ms interval
    let _ = blinker.push_schedule(Schedule::Infinite(Duration::from_millis(500)));
    // Run the blink pattern
    loop {
        let _ = blinker.step().await;
    }
}

See docs for more details.

Commit count: 34

cargo fmt