Commit fc40623d authored by Michael Nelson's avatar Michael Nelson

Set up extra pin

parent 0bf1c6ba
......@@ -62,6 +62,7 @@
#define PIN_OUT_BLINKER_L 4
#define PIN_OUT_BLINKER_R 5
#define PIN_OUT_HORN 6
#define PIN_OUT_EXTRA 7
// Config
#define BLINK_RATE 150
......@@ -114,6 +115,12 @@ void setup()
pinMode(PIN_OUT_BLINKER_L, OUTPUT);
pinMode(PIN_OUT_BLINKER_R, OUTPUT);
pinMode(PIN_OUT_HORN, OUTPUT);
pinMode(PIN_OUT_EXTRA, OUTPUT);
digitalWrite(PIN_OUT_BLINKER_L, LOW);
digitalWrite(PIN_OUT_BLINKER_R, LOW);
digitalWrite(PIN_OUT_HORN, LOW);
if (digitalRead(PIN_IN_LEFT_GRIP_BUTTON) == LOW) {
firmware_mode = true;
......@@ -265,6 +272,7 @@ void reset_all()
digitalWrite(PIN_OUT_BLINKER_L, LOW);
digitalWrite(PIN_OUT_BLINKER_R, LOW);
digitalWrite(PIN_OUT_HORN, LOW);
digitalWrite(PIN_OUT_EXTRA, LOW);
}
void loop()
......@@ -304,7 +312,10 @@ void loop()
// Horn is driven asynchronously from the rest of the blinking logic
if (hold_time[btn_horn] > 0)
{
digitalWrite(PIN_OUT_HORN, HIGH); // TOOOOOOT
digitalWrite(PIN_OUT_BUILTIN_LED, HIGH);
}
else
digitalWrite(PIN_OUT_HORN, LOW);
......
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