Created
December 16, 2019 01:17
-
-
Save adlerweb/e669756a715a802ad6048557f60db64f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define BLINK_DELAY 100 //ms between blinks | |
#define BLINK_PAUSE 3 //3x DELAY for pause | |
void blinkDigit(byte digit) { | |
for(byte i=0; i<digit; i++) { | |
digitalWrite(LED_BUILTIN, HIGH); | |
delay(BLINK_DELAY); | |
digitalWrite(LED_BUILTIN, LOW); | |
delay(BLINK_DELAY); | |
} | |
delay(BLINK_DELAY*BLINK_PAUSE); | |
} | |
void blinkNumber(float number) { | |
float numberC = 1000; | |
for(byte ndigit=6; ndigit>0; ndigit--) { | |
blinkDigit(number / numberC); | |
number -= ((int)(number / numberC) * numberC); | |
numberC /= 10; | |
} | |
} | |
//Min: 0.01; Max: 9999.99 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment