Hi,
I'm working on an Arduino project, and I was wondering if it was possible to rename the pins. Say, renaming pins 0/1/2/3 to A/B/C/D, and change 4-15 to 0-9?
I would want it to be in the bootloader of the ATmega, as I would want to make this project commercial eventually.
Thanks,
Will
I don't know if it is possible. I can understand doing something like that for your own convenience but I reckon if you want programs to share with others it would just cause great confusion.
...R
Your program can address a pin by any name you want, other than reserved language keywords.
byte A = 0;
pinMode(A, OUTPUT);
digitalWrite(A,1);
I would want it to be in the bootloader of the ATmega
The bootloader knows nothing about pin names.
Your program can address a pin by any name you want
but not if the name starts with a numeral
Say, renaming pins 0/1/2/3 to A/B/C/D,
Just start your code with:-
#define A 0
define B 0
define C 0
define D 0
You need pin names to be resolvable during compile time into numbers because that is how the rest of the functions that depend on pin numbers are defined.
would want to make this project commercial eventually
Why is this an issue, your customers will never see your code unless you give it to them?
In a commercial project you may want to access pins by their native names, not by the Arduino pin numbers. See the controller data sheets for the I/O register and bit names.