SparkFun Forums 

Where electronics enthusiasts find answers.

For the discussion of Arduino related topics.
By roboticssushi
#198464
Hello, I am currently working with fingerprint as to how it will input id numbers using numeric keypad. The code given below is used for my serial input numbers. Also I want it just to limit it to 5 IDs. Thank you so much!
Code: Select all
uint8_t readnumber(void) {
  uint8_t num = 0;
  
  while (num == 0) {
    while (! Serial.available());
    num = Serial.parseInt();
  }
  return num;
}