Skip to content

Instantly share code, notes, and snippets.

@iotguider
Last active May 19, 2018 09:03
Show Gist options
  • Save iotguider/351e6fde9c8a6f2b453f2e096f36bbee to your computer and use it in GitHub Desktop.
Save iotguider/351e6fde9c8a6f2b453f2e096f36bbee to your computer and use it in GitHub Desktop.
Code for Serial communication receiver Arduino
char mystr[10]; //Initialized variable to store recieved data
void setup() {
// Begin the Serial at 9600 Baud
Serial.begin(9600);
}
void loop() {
Serial.readBytes(mystr,5); //Read the serial data and store in var
Serial.println(mystr); //Print data on Serial Monitor
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment