const int REDPin = 12;
const int GREENPin = 13;
const int BLUEPin = 14;
void setColourRgb(unsigned int red, unsigned int green, unsigned int blue) {
analogWrite(REDPin, red);
analogWrite(GREENPin, green);
analogWrite(BLUEPin, blue);
}
void setup(void){
Serial.begin(115200);
pinMode(REDPin, OUTPUT);
pinMode(GREENPin, OUTPUT);
pinMode(BLUEPin, OUTPUT);
setColourRgb(0,0,0); //off
Serial.println("Started");
}
void loop(void){
delay(1000);
Serial.println("DeepSleep now");
ESP.deepSleep(10000000, WAKE_RF_DEFAULT); // Sleep 10 sec
delay(1000);
}
The RGB Led (or 3 standard leds!) will be off for 1 second (execution time) and will be slightly turned on for 10 seconds (deep sleep time) ending with a "strong" blink when the deep sleep ends and ESP reboots!
What do you suggest?