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
If these are not consistent across all micro-controllers then you have a new wrinkle and it is something that would have to be implemented at the IO level, not in J5. Also I think of Firmata as our "first class" citizen, not Arduino. That's where we should look for guidance. Do these constants make sense or already exist in Firmata? If so, then we can go for it but all the IO's are essentially Firmata compatibility layers and this would have to be addressed in each and every one.
HIGH and LOW are easy enough, but pins and modes could vary. I think you'd need an audit of all the devices supported by Johnny-Five to make sure you aren't introducing something that would be self contradictory in some cases.