2016-10-22 16:53:29 +00:00
|
|
|
#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) {
|
2016-10-27 16:14:29 +00:00
|
|
|
#if LORADEV == 1
|
2016-10-22 16:53:29 +00:00
|
|
|
BLUE();
|
2016-10-27 16:14:29 +00:00
|
|
|
#elif LORADEV == 2
|
2016-10-22 20:38:24 +00:00
|
|
|
RED();
|
2016-10-27 16:14:29 +00:00
|
|
|
#elif LORADEV == 3
|
2016-10-22 16:53:29 +00:00
|
|
|
GREEN();
|
2016-10-27 16:14:29 +00:00
|
|
|
#elif LORADEV == 4
|
2016-10-22 20:38:24 +00:00
|
|
|
WHITE();
|
2016-10-27 16:14:29 +00:00
|
|
|
#endif
|
2016-10-22 16:53:29 +00:00
|
|
|
delay(length);
|
|
|
|
CLEAR();
|
|
|
|
}
|
2016-10-24 19:34:02 +00:00
|
|
|
|
|
|
|
void setupLED() {
|
|
|
|
pinMode(LED_RED, OUTPUT);
|
|
|
|
pinMode(LED_GREEN, OUTPUT);
|
|
|
|
pinMode(LED_BLUE, OUTPUT);
|
|
|
|
}
|