Skip to content

Commit

Permalink
Merge pull request #2 from patrickrb/patch-1
Browse files Browse the repository at this point in the history
Changed delays in bling mode to timers
  • Loading branch information
rixon authored Jul 17, 2017
2 parents 1d40bfa + 2296895 commit 5f1239f
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions BadgeCode/BadgeCode.ino
Original file line number Diff line number Diff line change
Expand Up @@ -202,19 +202,26 @@ void drawBling()
Serial.println ("Draw Bling Called");
}
int repeat = 1;
while (repeat > 0) {
long imageTimer = millis();
digitalWrite(ledPin, LOW); //LED is OFF
oled.clearDisplay(); // clear the display SecKC DefCon Bitmap
oled.drawBitmap(SecKCFuzzy,1024);
delay(2000);
oled.drawBitmap(BobSmall,1024);
delay(2000);
oled.drawBitmap(DCXXV,1024);
delay(2000);
oled.drawBitmap(DCP,1024);
delay(2000);
menuPosSelected = 0; // reset the menu selection
oled.clearDisplay();
while (repeat > 0) {
if(millis() - imageTimer <= 2000)
{
oled.drawBitmap(SecKCFuzzy,1024);
}
if((millis() - imageTimer >= 2001) && (millis() - imageTimer <= 4000)){
oled.drawBitmap(BobSmall,1024);
}
if((millis() - imageTimer >= 4001) && (millis() - imageTimer <= 6000)){
oled.drawBitmap(DCXXV,1024);
}
if((millis() - imageTimer >= 6001) && (millis() - imageTimer <= 8000)){
oled.drawBitmap(DCP,1024);
}
if(millis() - imageTimer >= 8001){
imageTimer = millis();
}
}
}

Expand Down

0 comments on commit 5f1239f

Please sign in to comment.