Simple 6-LED bar library. Provides some useful functions.
Simple 6 leds bar library. It allows you to control individual leds, and provides masks.
Diff: 6LedBar.cpp
- Revision:
- 4:ecb39b6f0e18
- Parent:
- 1:248129e96f43
diff -r bb53fa90af91 -r ecb39b6f0e18 6LedBar.cpp --- a/6LedBar.cpp Sun May 21 14:29:24 2017 +0000 +++ b/6LedBar.cpp Sun May 21 14:59:47 2017 +0000 @@ -53,4 +53,15 @@ toggle(i); } } +} + +void LedBar::set_mask(int m) { + for(int i = 0; i < LEDS_COUNT; i++) { + if(m & (1 << i)) { + on(i); + } + else { + off(i); + } + } } \ No newline at end of file