Advertisement
baldengineer

Serial Receive

Jul 21st, 2012
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.27 KB | None | 0 0
  1. if (initial_char == '!') {
  2.   while(1) {
  3.     while (!Serial.available());  // wait for characters to arrive
  4.     tmpchar=Serial.read();
  5.     if (tmpchar != '\n') {
  6.       strcat(msg, (const char*)tmpchar);
  7.     } else {
  8.       break;  // break out of the while(1)
  9.     }
  10.   }
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement