4个版本
0.2.0 | 2021年9月17日 |
---|---|
0.1.2 | 2020年7月26日 |
0.1.1 | 2020年7月26日 |
0.1.0 | 2020年7月26日 |
1622 在 嵌入式开发
每月125 次下载
23KB
305 行
Blinq - 一个闪烁队列
一个用于切换GPIO或闪烁LED的队列,其中二进制模式编码为u32。
示例
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<9, FakeGpio> = 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();
许可证
许可协议为以下之一
-
Apache License,版本2.0 (LICENSE-APACHE 或 https://apache.ac.cn/licenses/LICENSE-2.0)
-
MIT许可证 (LICENSE-MIT 或 http://opensource.org/licenses/MIT)
任选其一。
贡献
除非您明确声明,否则根据Apache-2.0许可证定义的,您有意提交的任何贡献,均应按上述方式双许可,不附加任何额外条款或条件。
依赖项
~715KB
~13K SLoC