Commit 06585fa0 authored by Michael Nelson's avatar Michael Nelson

Test horn with R led button

parent 041da76b
......@@ -40,7 +40,7 @@
#define PIN_OUT_SPEAKER 6
#define PIN_OUT_BLINKER_L 7
#define PIN_OUT_BLINKER_R 8
#define PIN_OUT_WHITES 9
#define PIN_OUT_HORN 9
// Config
#define BLINK_RATE 250
......@@ -256,13 +256,14 @@ void set_up_mode()
}
else if (input_single_left_hit)
fg_mode = fg_mode == FG_MODE_BLINK_L ? MODE_OFF : FG_MODE_BLINK_L;
else if (input_hold_right_hit)
{
bg_mode = bg_mode == BG_MODE_AUXILARY_LIGHTS ? MODE_OFF : BG_MODE_AUXILARY_LIGHTS;
fg_mode = MODE_OFF;
}
else if (input_single_right_hit)
fg_mode = fg_mode == FG_MODE_BLINK_R ? MODE_OFF : FG_MODE_BLINK_R;
// TODO Temporary disabling testing horn
/* else if (input_hold_right_hit) */
/* { */
/* bg_mode = bg_mode == BG_MODE_AUXILARY_LIGHTS ? MODE_OFF : BG_MODE_AUXILARY_LIGHTS; */
/* fg_mode = MODE_OFF; */
/* } */
/* else if (input_single_right_hit) */
/* fg_mode = fg_mode == FG_MODE_BLINK_R ? MODE_OFF : FG_MODE_BLINK_R; */
}
void reset_all()
......@@ -278,7 +279,7 @@ void reset_all()
digitalWrite(PIN_OUT_BLINKER_R, LOW);
digitalWrite(PIN_OUT_LEFT_BUTTON_LED, LOW);
digitalWrite(PIN_OUT_RIGHT_BUTTON_LED, LOW);
digitalWrite(PIN_OUT_WHITES, LOW);
digitalWrite(PIN_OUT_HORN, LOW);
}
bool scooter_is_off()
......@@ -288,8 +289,8 @@ bool scooter_is_off()
void loop()
{
if (scooter_is_off())
return;
/* if (scooter_is_off()) */
/* return; */
delay(1);
set_up_mode();
......@@ -313,6 +314,12 @@ void loop()
else
reset_all();
// TODO Temporary testing horn
if (right_hold_time > 0)
digitalWrite(PIN_OUT_HORN, HIGH);
else
digitalWrite(PIN_OUT_HORN, LOW);
last_fg_mode = fg_mode;
last_bg_mode = bg_mode;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment