use blink for display
This commit is contained in:
parent
6719cabaa7
commit
b9be9b84ea
1 changed files with 12 additions and 11 deletions
23
the-cup.ino
23
the-cup.ino
|
|
@ -119,18 +119,19 @@ void byte_to_string(byte array[], unsigned int len, char buffer[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void displayError() {
|
void displayError() {
|
||||||
for (unsigned int i = 0; i < 6; i++)
|
blink(6, 300);
|
||||||
{
|
|
||||||
digitalWrite(LED_PIN, HIGH);
|
|
||||||
delay(600);
|
|
||||||
digitalWrite(LED_PIN, LOW);
|
|
||||||
delay(300);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void displaySuccess() {
|
void displaySuccess() {
|
||||||
digitalWrite(LED_PIN, HIGH);
|
blink(1, 1000);
|
||||||
delay(1000);
|
}
|
||||||
digitalWrite(LED_PIN, LOW);
|
|
||||||
delay(300);
|
void blink(unsigned int times, unsigned int duration) {
|
||||||
|
for (unsigned int i = 0; i < times; i++)
|
||||||
|
{
|
||||||
|
digitalWrite(LED_PIN, HIGH);
|
||||||
|
delay(duration);
|
||||||
|
digitalWrite(LED_PIN, LOW);
|
||||||
|
delay(duration);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue