When using D8 in the code doesn't work, nothing happens, but replacing D8 with 15 works like a charm. And to test this I created the code below. I know that D8 has worked earlier, but I don't remember which version I was using at that time, but it was a yer or more ago.
Environment:
- Arduino IDE ver. 1.8.13
- ESP8266 board ver. 2.7.4
- Witty Cloud or my add on version to WeMos D1 (https://oshpark.com/shared_projects/r3NRvNjx)
- WeMos D1 R1 chosen in Board manager
// "Witty Cloud" test program // A0 - LDR resistor // D2 - Button // D6 - Green LED // D7 - Blue LED // D8 - Red LED // Constants won't change. They're used here to set pin numbers: const int LDR = A0; const int BUTTON = D4; const int GREEN = D6; const int BLUE = D7; const int RED = D8; void setup() { Serial.begin(115200); pinMode(LDR, INPUT); pinMode(RED, OUTPUT); pinMode(GREEN, OUTPUT); pinMode(BLUE, OUTPUT); pinMode(BUTTON, INPUT); } void loop() { delay(1000); Serial.println(""); Serial.print("LDR: "); Serial.println(analogRead(LDR)); digitalWrite(RED, HIGH); digitalWrite(BLUE, LOW); Serial.println("--- Red ---"); delay(1000); digitalWrite(RED, LOW); digitalWrite(GREEN, HIGH); Serial.println("--- Green ---"); delay(1000); digitalWrite(GREEN, LOW); digitalWrite(BLUE, HIGH); Serial.println("--- Blue ---"); }
static const uint8_t D8 = 0;bummer