I have a code I’ve been working on for awhile. Up until Monday, it would verify and upload to my controller without issue. I added a few void commands, but that shouldn’t be affecting my global variable declaration. When I try to denote relayPin0 as the variable “D0” I keep getting an error message that D0 is not declared in this scope. Any thoughts on what could be causing this?
Did you change the board you have selected from the Tools > Board menu? Only some of the ESP8266 boards define pin numbers using the Dn pin numbers. For example, the "LOLIN(WEMOS) D1 R2 & mini" board does:
but the "Adafruit Feather HUZZAH ESP8266" board does not:
The reason for this is that some manufacturers decided to label the pins on their boards (e.g. WeMos D1 Mini) with arbitrary numbers, and so a mapping between those numbers and the ESP8266 GPIO pin numbers used internally by the ESP8266 core for Arduino is required. That was accomplished by adding these Dn definitions in the variant files used by those boards. Other manufacturers labeled their boards with the actual GPIO numbers of each pin, and so no Dn notations were required. I suppose it might have made sense to add dummy definitions to those variants for the sake of intercompatibility: