2

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:


// "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 ---"); } 
4
  • Have you looked at the core of your board? In wiring.c (i think) these makros should be defined. Are they defined with the pin number or the bit number in the port? Commented Oct 21, 2020 at 9:08
  • I actually found the error, check, github.com/esp8266/Arduino/blob/master/variants/d1/… and found the row static const uint8_t D8 = 0; bummer Commented Oct 21, 2020 at 9:14
  • 1
    D1 R1 has different pin mapping then R2 and mini Commented Oct 21, 2020 at 9:19
  • Now I see my mistake, I chosed a "WeMos R1" and not "LOLIN(WEMOS) D1 Mini".... why has WeMos changed to LOLIN ? Commented Oct 21, 2020 at 9:38

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.