Lesson 5-2: Reading User Input, Printing Received Data from the Serial Monitor
This is lecture 0 of the Arduino Step-by-Step course.529-Lesson 5: Introduction to the Serial Monitor
Язык: C++
/*
*
* Reading user input, printing received data from the Serial Monitor
* Arduino code demonstrating Serial Monitor use
* S01-05-2
* Serial Monitor example
* Video instruction for this code: https://youtu.be/WyWRGoACWFs
* This code is part of an Arduino Course
with over 100 lectures, free on YouTube. Watch it here: http://robojax.com/L/?id=338
Get the code for the course: http://robojax.com/L/?id=339
* written by Ahmad Shamshiri for Robojax
* http://robojax.com
* Written on February 17, 2019
*/
void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
}
void loop() {
// send data only when you receive data:
if (Serial.available() > 0) {
Serial.println( Serial.read() );
}
}
Ресурсы и ссылки
Ресурсов пока нет.
Файлы📁
Нет доступных файлов.