Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.