Skip to content

Commit

Permalink
lib: Add panic if neopixel does not exist
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick José Pereira <[email protected]>
  • Loading branch information
patrickelectric committed Dec 9, 2024
1 parent 12a2912 commit 3c058c7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,13 @@ impl Navigator {
}
}

pub fn set_neopixel_rgbw(&mut self, colors: &[[u8; 4]]) {
self.get_rgb_behaviour()
.expect("No RGB controller available")
.set_colors_rgbw(colors)
.expect("Failed to set RGB colors");
}

pub fn read_all(&mut self) -> SensorData {
SensorData {
adc: self.read_adc_all(),
Expand Down

0 comments on commit 3c058c7

Please sign in to comment.