lorawan/sodaq_one/ledcolours.ino
Nico Schottelius 95d8e8bfe5 update
Signed-off-by: Nico Schottelius <nico@wurzel.schottelius.org>
2016-10-27 18:14:29 +02:00

57 lines
1 KiB
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) {
#if LORADEV == 1
BLUE();
#elif LORADEV == 2
RED();
#elif LORADEV == 3
GREEN();
#elif LORADEV == 4
WHITE();
#endif
delay(length);
CLEAR();
}
void setupLED() {
pinMode(LED_RED, OUTPUT);
pinMode(LED_GREEN, OUTPUT);
pinMode(LED_BLUE, OUTPUT);
}