Serial Monitor
The Arduino has no screen, but it can talk through the USB cable. Serial.print sends a number or a word to the computer, and the Serial Monitor in the Arduino IDE (the magnifying glass, top right) shows it. Print first, decide later: when you see the numbers, you can choose a good rule.
Serial.begin(9600) in setup, Serial.println(value) wherever you want to see something. The monitor must be set to 9600 too.
More: print, println and reading the numbers
void setup() { Serial.begin(9600); // 9600 bits every second: the speed the monitor expects } void loop() { int value = analogRead(A0); Serial.print("A0 = "); // print: stays on the same line Serial.println(value); // println: ends the line delay(200); }
Strange characters instead of numbers? The speed in the monitor is not 9600. Nothing at all? Choose the port of your board, and check that the program has Serial.begin. Print only every 100 ms or so: thousands of lines a second are too fast to read, and they slow the board down.
The Micro:bit shows numbers on its own LEDs with show number; the Arduino prints them here instead.