Skip to content

Instantly share code, notes, and snippets.

@UserAd
Created March 31, 2017 09:01
Show Gist options
  • Save UserAd/dd4105cc3f3759794fc16d3ded2c1cf5 to your computer and use it in GitHub Desktop.
Save UserAd/dd4105cc3f3759794fc16d3ded2c1cf5 to your computer and use it in GitHub Desktop.
int result = 0;
void loop() {
char key = kpd.getKey();
if(key) // Check for a valid key.
{
switch (key)
{
case '*':
result = 0;
break;
case '#':
result = 0;
break;
default:
result = result * 10 + toInt(key)
Serial.println(result);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment