Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexGyver committed Jun 13, 2019
1 parent b93c497 commit f440172
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions firmware/GyverLamp_v1.0/button.ino
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ void buttonTick() {
if (dawnFlag) {
manualOff = true;
dawnFlag = false;
loadingFlag = true;
FastLED.setBrightness(modes[currentMode].brightness);
changePower();
} else {
if (ONflag) {
ONflag = false;
Expand Down
10 changes: 6 additions & 4 deletions firmware/GyverLamp_v1.0/time.ino
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ void timeTick() {
if (alarm[thisDay].state && // день будильника
thisTime >= (alarm[thisDay].time - dawnOffsets[dawnMode]) && // позже начала
thisTime < (alarm[thisDay].time + DAWN_TIMEOUT) ) { // раньше конца + минута
if (!manualOff && ONflag) {
if (!manualOff) {
// величина рассвета 0-255
int dawnPosition = 255 * ((float)(thisTime - (alarm[thisDay].time - dawnOffsets[dawnMode])) / dawnOffsets[dawnMode]);
dawnPosition = constrain(dawnPosition, 0, 255);
Expand All @@ -23,9 +23,11 @@ void timeTick() {
dawnFlag = true;
}
} else {
dawnFlag = false;
manualOff = false;
FastLED.setBrightness(modes[currentMode].brightness);
if (dawnFlag) {
dawnFlag = false;
manualOff = false;
FastLED.setBrightness(modes[currentMode].brightness);
}
}

}
Expand Down

0 comments on commit f440172

Please sign in to comment.