57 lines
994 B
C++
57 lines
994 B
C++
#include <Arduino.h>
|
|
|
|
void BLUE() {
|
|
digitalWrite(LED_RED, HIGH);
|
|
digitalWrite(LED_GREEN, HIGH);
|
|
digitalWrite(LED_BLUE, LOW);
|
|
}
|
|
|
|
void RED() {
|
|
digitalWrite(LED_RED, LOW);
|
|
digitalWrite(LED_GREEN, HIGH);
|
|
digitalWrite(LED_BLUE, HIGH);
|
|
}
|
|
|
|
void YELLOW() {
|
|
digitalWrite(LED_RED, LOW);
|
|
digitalWrite(LED_GREEN, LOW);
|
|
digitalWrite(LED_BLUE, HIGH);
|
|
}
|
|
|
|
void WHITE() {
|
|
digitalWrite(LED_RED, LOW);
|
|
digitalWrite(LED_GREEN, LOW);
|
|
digitalWrite(LED_BLUE, LOW);
|
|
}
|
|
|
|
void GREEN() {
|
|
digitalWrite(LED_RED, HIGH);
|
|
digitalWrite(LED_GREEN, LOW);
|
|
digitalWrite(LED_BLUE, HIGH);
|
|
}
|
|
|
|
void CLEAR() {
|
|
digitalWrite(LED_RED, HIGH);
|
|
digitalWrite(LED_GREEN, HIGH);
|
|
digitalWrite(LED_BLUE, HIGH);
|
|
}
|
|
|
|
|
|
void blink(int length) {
|
|
switch(deviceNo) {
|
|
case 1:
|
|
BLUE();
|
|
break;
|
|
case 2:
|
|
WHITE();
|
|
break;
|
|
case 3:
|
|
GREEN();
|
|
break;
|
|
case 4:
|
|
RED();
|
|
break;
|
|
}
|
|
delay(length);
|
|
CLEAR();
|
|
}
|