Gorkde:
It seems I found the problem....
I tried to use Pin numbers instead A0 or D0.... This compiled but did get me the wrong output....
Then I realized:
Digital Pins are no longer labled as D5 but 5 instead while analog Pins are labled A0-A5....
This is pretty riddiculus in my opinion!
This is not easier but way more confusing for beginners as well as people used to the old labeling!
If you are using naked pin numbers and not addressing the proper pin, then either you have selected the incorrect board type or are using a wemos board.
While some 3rd party core board variants support using Dn symbols for digital pins
I've not seen Dn symbols in the arduino.cc supplied AVR cores and board types of an any version of the IDE going back to before 1.0 and up to the present.
Naked number constants has always worked for both arduino digital pins and arduino analog pins.
The An symbols were created in IDE version 1.0 when the concept of board variants was also invented/added.
However as far as I've seen, Dn symbols were never added to the arduino.cc supplied cores board variants.
And even though the An symbols were added, naked constants still worked. i.e. 0 is the same A0 for analog operations.
I'll agree that there can be confusion for the esp8266 Wemos boards (which are only a subset of the boards in the esp8266 core).
On those particular boards, you must use Dn to control the associated pin.
This was a trade off between UNO compatibility and performance. It was carried over into the Wemos mini devices.
On all other boards you simply use the naked number constant.
There may be some 3rd party cored variant files that do define Dn symbols but I have not see that the official Arduino cores ever created these.
Can you provide a specific version of the IDE, core and board type that you were using that supported Dn but now doesn't?
Perhaps you are thinking of the Dn symbols with some other notations you may have seen like
PIN_{port}{bit} that is in some 3rd party AVR cores and board types.
This creates defines like PIN_D0, PIN_D1, PIN_B2 etc... but the Dn symbols are not for digital pin 0 and digital pin 1 but rather AVR port D bit 0 and AVR port D bit 1 etc....
More recent arduino.cc core and board variant files now contain PIN_An symbols for the analog pins.
IMO, this was not a good thing to add as the An symbols already existed and the PIN_An symbols collide with 3rd party AVR and board types that were already using PIN_{port]{bit} notation. i.e. PIN_A0 on the third party core was AVR port A bit 0 but on the now on the newer IDEs and arduino.cc AVR core, PIN_A0 means the same as A0 which is the same analog pin 0.
--- bill