Skip to content

Instantly share code, notes, and snippets.

@101Robotics
Created February 7, 2018 22:46
Show Gist options
  • Save 101Robotics/26f90d4630423ae48c96cc07f4ac9606 to your computer and use it in GitHub Desktop.
Save 101Robotics/26f90d4630423ae48c96cc07f4ac9606 to your computer and use it in GitHub Desktop.
void setup() {
// put your setup code here, to run once:
Serial.begin(9600); //Initialization serial communication at 9600 bauds(default setting)
//The baud is a unit used to measure the speed of transmission of information
Serial.println("Hello Steem !"); //Display a message (here it is: Hello Steem!) And then return to the line (because of the ln after the print)
}
void loop() {
// put your main code here, to run repeatedly:
if (Serial.available() ) //If the condition between () is true then :
{
//If a message has been received do this
Serial.print("Votre message: "); //Display a message without returning to the line
Serial.println(Serial.readString()); // Read the received message and display it on the monitor
}
else
{
// If nothing is received do this (you can put here what you want)
//It is not mandatory to put an else (if not) after an if if you do not need it
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment