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