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