The Arduino programming environment is bootstrapped with many preprocessor definition contant values, specifically created to make the programming experience more accessible to non-programmers. Some specific examples include:
- Analog Pins:
A0
: 14A1
: 15
- Modes:
INPUT
: 0OUTPUT
: 1
- Values:
HIGH
: 1LOW
: 0
Please post thoughts in the comments. I'd like to flesh out the lists below before making a decision.
- Easily memorized by users
- Increased accessibility for those familiar with Arduino IDE programming
- Potentially reduce user code errors (?)
- Global scope pollution
@soundanalogous when you develop for a micro controller you really do know which one is that, you don't ping or use ports by accident and you might eventually rely on the equivalent of a
navigator.userAgent
that tells you which board is it so you can alias public global constants.Someone might think
navigator.userAgent
is a bad practice and it is comapred to feature detections ... now, you have 30KB in total on Espruino Pico, as example, there it goes your wasted feature detection code: it won't fit in there, as easy as that.You should know your target, or distaster occurs, accordingly, if A1 points to a different A1 in different boards, I am not sure that's a real concern. HIGH and LOW would improbably be different from 1 and 0
Again, just my thoughts