Commit af7963d6 authored by Michael Nelson's avatar Michael Nelson

Make grip switch the left blinker

parent 06585fa0
......@@ -21,7 +21,7 @@
// Green striped - Right button
// Orange - Left button LED
// Orange striped - Right button LED
// Blue - Available
// Blue - Left handlebar grip tactile switch
// Blue striped - Available
// Inputs
......@@ -30,7 +30,7 @@
#define PIN_IN_SCOOTER_STATUS 2
// TODO
// #define PIN_IN_BLUE_SOLID 10
#define PIN_IN_LEFT_GRIP_BUTTON 10
// #define PIN_IN_BLUE_STRIPED 11
// Outputs
......@@ -79,6 +79,9 @@ void setup()
pinMode(PIN_IN_LEFT_BUTTON, INPUT_PULLUP);
pinMode(PIN_IN_RIGHT_BUTTON, INPUT_PULLUP);
pinMode(PIN_IN_LEFT_GRIP_BUTTON, INPUT_PULLUP);
pinMode(PIN_IN_SCOOTER_STATUS, INPUT_PULLUP);
pinMode(PIN_OUT_SPEAKER, OUTPUT);
......@@ -170,9 +173,9 @@ void read_dual_buttons()
input_hold_right_hit = false;
input_hold_both_hit = false;
if (digitalRead(PIN_IN_LEFT_BUTTON) == LOW && digitalRead(PIN_IN_RIGHT_BUTTON) == LOW)
if (digitalRead(PIN_IN_LEFT_GRIP_BUTTON) == LOW && digitalRead(PIN_IN_RIGHT_BUTTON) == LOW)
both_hold_time++;
else if (digitalRead(PIN_IN_LEFT_BUTTON) == LOW)
else if (digitalRead(PIN_IN_LEFT_GRIP_BUTTON) == LOW)
left_hold_time++;
else if (digitalRead(PIN_IN_RIGHT_BUTTON) == LOW)
right_hold_time++;
......
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