Skip to content

Commit

Permalink
Status led night mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbig committed Jun 17, 2016
1 parent 0b1f8fe commit 7498ced
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
7 changes: 3 additions & 4 deletions statusled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,9 @@ void StatusLED::tick() {
if (pos >= sizeof(animPulse) / 2) pos = 0;
} else {
// Short pings when reception acquired
analogWrite(CFG_LED_STATUS, 0);
if (pos == 0) digitalWrite(CFG_LED_STATUS, 0);
else digitalWrite(CFG_LED_STATUS, 1);
if (++pos >= 150) pos = 0;
if (pos == 0) analogWrite(CFG_LED_STATUS, GPS::isNight() ? 900 : 1);
else analogWrite(CFG_LED_STATUS, 1023);
if (++pos >= 15) pos = 0;
}
}

1 change: 1 addition & 0 deletions statusled.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "config.h"
#include <EventManager.h>
#include <Ticker.h>
#include "gps.h"

class StatusLED {
public:
Expand Down

0 comments on commit 7498ced

Please sign in to comment.