Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jamesmunns/choreographer
A color pattern sequencer, intended for groups of RGB LEDs
https://github.com/jamesmunns/choreographer
Last synced: 11 days ago
JSON representation
A color pattern sequencer, intended for groups of RGB LEDs
- Host: GitHub
- URL: https://github.com/jamesmunns/choreographer
- Owner: jamesmunns
- License: mpl-2.0
- Created: 2021-06-20T17:16:58.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-07-02T23:40:24.000Z (over 3 years ago)
- Last Synced: 2024-10-09T07:10:13.329Z (30 days ago)
- Language: Rust
- Size: 33.2 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Choreographer
A color pattern sequencer, intended for groups of RGB LEDs
## Example
Check out the video [in this tweet](https://twitter.com/bitshiftmask/status/1404633529179377673)
```rust
use choreographer::{
engine::{Behavior, Sequence},
script,
};
use groundhog::std_timer::Timer;
use std::thread::sleep;
use std::time::Duration;// Timer with 1us ticks
type MicroTimer = Timer<1_000_000>;// Create a script for a single LED with up to
// eight different steps in the sequence
let mut script: Sequence = Sequence::empty();// This script will:
// * Keep the LED black for 1s
// * Fade from black to white and back in a sine pattern over 2.5s
// * Remain at black for 1s
// * End the sequence
script.set(&script! {
| action | color | duration_ms | period_ms_f | phase_offset_ms | repeat |
| solid | BLACK | 1000 | 0.0 | 0 | once |
| sin | WHITE | 2500 | 2500.0 | 0 | once |
| solid | BLACK | 1000 | 0.0 | 0 | once |
}, Behavior::OneShot);// Poll the script and update the LED until the
// script has completed (4.5s or so)
while let Some(color) = script.poll() {
println!("Color: {:?}", color);
set_led(color);
sleep(Duration::from_millis(10));
}// Now we could leave the LED off, or set a
// new sequence on some event!
```## License
This project is licensed under the [Mozilla Public License v2.0](https://www.mozilla.org/en-US/MPL/2.0/).