Analyze if a char is alphanumeric (that is a letter or a number). Returns true if the input char contains either a number or a letter.
Use the following function to evaluate a char variable:
isAlphaNumeric(thisChar)
The function admits the following parameter:
thisChar: char variable to evaluate. Allowed data types: char.
The function returns true if the evaluated input variable is alphanumeric.
char myChar = '3'; // try with '#' for a non alphanumeric char
void setup() {
Serial.begin(9600);
if (isAlphaNumeric(myChar)) { // tests if myChar is a letter or a number
Serial.println("The character is alphanumeric");
} else {
Serial.println("The character is not alphanumeric");
}
}
void loop() {
}