From 0ee949ef7e317f9769f8c8b427b82f6d7e0ef351 Mon Sep 17 00:00:00 2001 From: Savanni D'Gerinel Date: Fri, 8 Nov 2024 09:44:13 -0500 Subject: [PATCH] Add a water pattern and disable the brake sensor --- bike-lights/bike/src/main.rs | 3 ++ bike-lights/core/src/lib.rs | 2 +- bike-lights/core/src/patterns.rs | 69 +++++++++++++++++++++++++++++++- 3 files changed, 72 insertions(+), 2 deletions(-) diff --git a/bike-lights/bike/src/main.rs b/bike-lights/bike/src/main.rs index 2805332..4780661 100644 --- a/bike-lights/bike/src/main.rs +++ b/bike-lights/bike/src/main.rs @@ -119,6 +119,7 @@ impl< > UI for BikeUI { fn check_event(&mut self, current_time: Instant) -> Option { + /* if self.brake_sensor.is_high().unwrap_or(true) && !self.brake_enabled { self.brake_enabled = true; Some(Event::Brake) @@ -126,6 +127,8 @@ impl< self.brake_enabled = false; Some(Event::BrakeRelease) } else if self.left_blinker_button.is_low(current_time) { + */ + if self.left_blinker_button.is_low(current_time) { self.left_blinker_button.set_debounce(current_time); Some(Event::LeftBlinker) } else if self.right_blinker_button.is_low(current_time) { diff --git a/bike-lights/core/src/lib.rs b/bike-lights/core/src/lib.rs index 3bc79be..824f1ca 100644 --- a/bike-lights/core/src/lib.rs +++ b/bike-lights/core/src/lib.rs @@ -336,7 +336,7 @@ impl Pattern { fn body(&self) -> BodyPattern { match self { - Pattern::Water => OFF_BODY, + Pattern::Water => WATER_BODY, Pattern::GayPride => PRIDE_BODY, Pattern::TransPride => TRANS_PRIDE_BODY, } diff --git a/bike-lights/core/src/patterns.rs b/bike-lights/core/src/patterns.rs index 12fb7ed..9924967 100644 --- a/bike-lights/core/src/patterns.rs +++ b/bike-lights/core/src/patterns.rs @@ -98,7 +98,74 @@ pub const DEFAULT_FRAMES: U16F0 = U16F0::lit("30"); pub const WATER_DASHBOARD: DashboardPattern = [WATER_1, WATER_2, WATER_3]; -pub const WATER_BODY: BodyPattern = [RGB_OFF; 60]; +pub const WATER_BODY: BodyPattern = [ + WATER_1, + WATER_1, + WATER_1, + WATER_1, + WATER_1, + WATER_1, + WATER_1, + WATER_1, + WATER_1, + WATER_1, + + WATER_2, + WATER_2, + WATER_2, + WATER_2, + WATER_2, + WATER_2, + WATER_2, + WATER_2, + WATER_2, + WATER_2, + + WATER_3, + WATER_3, + WATER_3, + WATER_3, + WATER_3, + WATER_3, + WATER_3, + WATER_3, + WATER_3, + WATER_3, + + + WATER_3, + WATER_3, + WATER_3, + WATER_3, + WATER_3, + WATER_3, + WATER_3, + WATER_3, + WATER_3, + WATER_3, + + WATER_2, + WATER_2, + WATER_2, + WATER_2, + WATER_2, + WATER_2, + WATER_2, + WATER_2, + WATER_2, + WATER_2, + + WATER_1, + WATER_1, + WATER_1, + WATER_1, + WATER_1, + WATER_1, + WATER_1, + WATER_1, + WATER_1, + WATER_1, +]; pub const PRIDE_DASHBOARD: DashboardPattern = [PRIDE_RED, PRIDE_GREEN, PRIDE_INDIGO];