Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int getInput(int passthrough){
- counterA=0;
- if(Serial.available()){
- do{
- while(!Serial.available());
- inputByte=Serial.read();
- inputBytes[counterA++]=inputByte;
- if(checkDelim(inputByte)||counterA==INPUT_DIGIT_LIMIT+1)
- break;
- }while(true);
- inputBytes[counterA]='\n';
- return atoi(inputBytes);
- }
- return passthrough;
- }
- boolean checkDelim(int code){
- if(code==10||code==13)
- return true;
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement