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 8, 2024
1 parent 12a2912 commit 665616b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,14 @@ impl Navigator {
}
}

pub fn set_neopixel_rgbw(&mut self, colors: &[[u8; 4]]) {
if let Some(rgb_behaviour) = self.get_rgb_behaviour() {
rgb_behaviour.set_colors_rgbw(colors).unwrap();
} else {
panic!("No RGB controller available");
}
}

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

0 comments on commit 665616b

Please sign in to comment.