-
Notifications
You must be signed in to change notification settings - Fork 7
isDigit
gicking edited this page Feb 10, 2018
·
3 revisions
back to Command Reference / Characters
Analyse if a char is a digit (that is a number). Returns true if thisChar is a number.
- defined in
misc.h
- auto-loaded in
main_general.h
- no
#define
required
isDigit(thisChar)
-
input:
- thisChar: character to test (char)
-
output:
- none
- true: if thisChar is a number.
- false: otherwise
The below code reads a char from the terminal and checks for isDigit()
.
#include "main_general.h"
#include "uart1.h"
#include "putchar.h"
void setup() {
// init UART, printf() and gets()
UART1_begin(115200);
putcharAttach(UART1_write);
} // setup
void loop() {
if (UART1_available())
if (isDigit(UART1_read()))
printf("isDigit(x) = true\n");
else
printf("isDigit(x) = false\n");
}
- tbd
-
Getting Started
-
- General Commands
- Libraries
- LCD BTHQ21605V
- poti AD5280
- poti AD5282
- freemodbus
- PetitFS SD-card (min)
- FatFS: SD card (full)
- Board Specific
-
- Universal
- Board Specific