Skip to content

jamesmunns/blinq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Blinq - a blinking queue

Documentation

A queue for toggling a GPIO or blinking an LED, with binary patterns encoded as a u32.

Example

use blinq::{Pattern, Blinq, patterns, consts};

// Create a blink queue with room for 8 patterns (note: the capacity must be 1 higher
// then the amount of patterns you wish to store), that is active-low
let mut blinq: Blinq<FakeGpio, 9> = Blinq::new(gpio, true);

// Insert "HELLO." in morse code

blinq.enqueue(patterns::morse::H); // 8 steps
blinq.enqueue(patterns::morse::E); // 2 steps
blinq.enqueue(patterns::morse::L); // 10 steps
blinq.enqueue(patterns::morse::L); // 10 steps
blinq.enqueue(patterns::morse::O); // 12 steps
blinq.enqueue(patterns::morse::FULL_STOP); // 18 steps

// This is 60 steps
for _ in 0..60 {
   blinq.step();
}

// The queue is now exhausted, and the GPIO will be driven to the
// inactive state
blinq.step();

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

A Blinking Queue

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages