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