Lesson 8 Serial Monitor
In this experiment, you will learn how to turn on or off LEDs through a computer and the Serial Monitor. Serial Monitor is used for communication between the Uno board and a computer or other devices. It is a built-in software in the Arduino environment and you can click the button on the upper right corner to open it. You can send and receive data via the serial port on the Uno board and control the board by input from the keyboard.
In this experiment, since we use colored LEDs as loads, you can enter a color among red, green, and blue on Serial Monitor in the IDE. The corresponding LED on the SunFounder Uno board will then light up.
- 1 * SunFounder Uno board
- 1 * Breadboard
- 3 * LED
- 3 * Resistor (220Ω)
- Jumper wires
- 1 * USB cable
Here, the Serial Monitor serves as a transfer station for communication between your computer and the SunFounder Uno board. First, the computer transfers data to the Serial Monitor, and then the data is read by the SunFounder Uno board. Finally, the Uno will perform related operations.
Step 1: Build the circuit
The schematic diagram
Step 3: Compile the code
Step 4: Upload the sketch to the SunFounder Uno board
Now, click the Serial Monitor button at the upper right corner in the IDE. Then the Serial Monitor window will appear.
With this window, you can not only send data from your computer to the SunFounder Uno board, but also receive data from the board and display it on the screen. When you open the window, it will display "Please input any color of LED:". You can input a color here. If you enter red, green, or blue, click Send, then the corresponding LED on the breadboard will light up. However, if you enter any color other than these three, no LEDs will be on.
For example, if you input red, you will see the red LED light up.
Copyright © 2012 - 2016 SunFounder. All Rights Reserved.