lorawan/sodaq_one/ledcolours.ino

61 lines
1.1 KiB
Arduino
Raw Normal View History

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) {
#if LORADEV == 1
2016-10-22 16:53:29 +00:00
BLUE();
#elif LORADEV == 2
2016-11-03 07:08:08 +00:00
WHITE();
#elif LORADEV == 3
2016-11-02 16:38:56 +00:00
YELLOW();
#elif LORADEV == 4
2016-11-03 07:08:08 +00:00
RED();
2016-11-02 16:38:56 +00:00
#else
GREEN();
#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);
}