Analyze if a char is ASCII. Returns true if the input char contains an ASCII character.
Use the following function to evaluate a char variable:
isAscii(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 ASCII.
char myChar = 'A'; // try with 'é' for a non ASCII char
void setup() {
Serial.begin(9600);
if (isAscii(myChar)) { // tests if myChar is an ASCII character
Serial.println("The character is ASCII");
} else {
Serial.println("The character is not ASCII");
}
}
void loop() {
}