Arduino Beginner Tutorial 3: Using the Serial Monitor
by TheMaker09 in Circuits > Arduino
147 Views, 0 Favorites, 0 Comments
Arduino Beginner Tutorial 3: Using the Serial Monitor
You are going to learn how to use Arduino's serial monitor. This is very helpful for testing more complex projects as it can tell you what is going on in the Arduino's brain.
Supplies
1x Arduino Uno
Obviously, you need the cable that connects the Arduino to your computer.
Arduino IDE
Connect Arduino
Open Arduino IDE and connect the Arduino to the computer. Remember to go to tools then to board and click Arduino Uno (or the board you are using). then go to tools port and click the port that shows up.
Upload Code
Now upload this code to your Arduino.
void setup() { Serial.begin(9600); //starts the serial monitor. Litterally tells the arduino to start the serial monitor up.}void loop() { Serial.println(" ARDUINO 1: HELLO WORLD"); // since it is in quotes it tells the serial monitor to say "ARDUINO 1: hello WORLD" the println instead of just print tells it to make a new line when it says it's message delay(1000); Serial.println("ARDUINO 2: AND HELLO BACK TO YOU"); delay(1000);}
Now click the upload arrow or ctrl + u. Then click the magnifying glass in the top right corner of the Arduino IDE twice and it should show the serial monitor saying, "ARDUINO 1: HELLO WORLD" then on the next line it will say, "ARDUINO 2: AND HELLO BACK TO YOU" obviously there is no other Arduino it just it told to say that.
Done
You have officially used the serial monitor. This can be used to debug your complex projects by after a function saying to say what it is supposed to do and if it doesn't show it in the serial monitor then you know where your code is wrong.
Play around with it make some messages for the serial monitor by modifying the provided code. Have Fun!