I step through an array of pin numbers to scan multiple input with non sequential pin numbers.
I set this up using enum for scanning a bunch of pushbuttons.
enum buttonNames { Button0, Button1, Button2, Button3, Button4, Button5, Button6, Button7};
const int buttonPinNo[] = { 1, 0, 2, 4, 3, 9 , 6, 7 };
This first example works fine.
For a different project I wanted to use shorter names for the buttons and wrote it this way:
enum buttonNames { PB1, PB2, PB3, PB4, PB5 };
const int buttonPin[] = { 1, 0, 2, 3, 4 };
It gives an error for the labels PB1,PB2, etc. Any other form is acceptable Is upper case PB followed by a single numeral a keyword of some kind?
The following combinations do not cause an error
enum buttonNames { Pb1, pB2, pb3, PBa4, PB45 };
const int buttonPin[] = { 1, 0, 2, 3, 4 };
It is an easy work around but I am curious why that particular combination of characters does not work.