Serial Monitor
Read live sensor-style output on the serial monitor.
- Beginner
- Arduino
- 1 parts
Opens in your browser with the parts, wiring and code already in place. Press Run to watch it work, then change anything you like.
How it works
This circuit is only an Arduino Uno; nothing is wired to it. The board talks to your computer over its USB cable using serial communication, and the Serial tab in the editor is the simulated version of the Arduino IDE’s Serial Monitor. Printing from the board is the most useful debugging tool there is.
setup() starts serial at 9600 baud (bits per second) with Serial.begin(9600) and prints a greeting. loop() then prints “Uptime: ” followed by millis(), the number of milliseconds since the board started, and “ ms”, once a second. print() and println() differ only in that println() ends the line.
Parts
- Arduino Uno
Wiring
This circuit has no wires yet: it is a starting point to build on.
Arduino code
// Serial Monitor
void setup() {
Serial.begin(9600);
Serial.println("CYTHEIA Serial Monitor");
}
void loop() {
Serial.print("Uptime: ");
Serial.print(millis());
Serial.println(" ms");
delay(1000);
}
Try changing it
- Show whole seconds instead: change Serial.print(millis()); to Serial.print(millis() / 1000); and the unit text to " s".
- Print twice as often by changing delay(1000) to delay(500).