Ben
Well-known member
Is there a way to check if a number is inside the range of availabe(physically existing) digital pins on a board?
I'd like to use it to give interactive feedback on a serial console if a wrong pin number is send to the teensy, i'd like to use a helper function like so:
while 33 is correct on the Teensy 3.2, i'd rather have my code somewhat platform agnostic or platform-flexible by dynamically setting this upper limit at compile time to be compatible with upcoming T3++.
Is there something #defined to do this?
Ben
I'd like to use it to give interactive feedback on a serial console if a wrong pin number is send to the teensy, i'd like to use a helper function like so:
Code:
int isValidDigitalPin(int pin) {
if ( (pin >= 0) && (pin <= 33) ) return 1;
else return 0;
}
Is there something #defined to do this?
Ben