Skip to content

Commit

Permalink
added auto rotate functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
thexmanxyz authored Jun 25, 2019
1 parent f3ff86d commit 7b526c8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CUBE/CUBE.ino
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ uint16_t timer;

uint64_t randomTimer;

bool autoRotate = true;
uint64_t lastEffectChange = 0;
uint32_t effectDuration = 5000;

bool loading;

void setup() {
Expand All @@ -75,10 +79,11 @@ void setup() {
}

void loop() {

uint64_t currentTime = millis();
randomTimer++;

if (digitalRead(BUTTON_PIN) == LOW) {
if (digitalRead(BUTTON_PIN) == LOW || (currentTime - lastEffectChange >= effectDuration && autoRotate) {
lastEffectChange = millis();
clearCube();
loading = true;

This comment has been minimized.

Copy link
@parasm0802

parasm0802 Aug 16, 2019

Line 85 have error
exit status 1
expected ')' before '{' token

timer = 0;
Expand Down

0 comments on commit 7b526c8

Please sign in to comment.