Saltar al contenido

Lesson 6: The Serial Monitor

English

The board can talk

  • Serial.begin(9600); opens the cable to the computer at 9600 bits per second.
  • Serial.println("Hi"); sends a line. You see it under the board, in the Serial Monitor.
  • Serial.print does the same without a new line.
int count = 0;

void setup() {
  Serial.begin(9600);
  Serial.println("Hello!");
}

void loop() {
  count = count + 1;
  Serial.print("Count: ");
  Serial.println(count);
  delay(1000);
}
  • This is how Arduino programmers find bugs: print the numbers and look at them.

Iniciar sesión o crear cuenta

IGCSE, A-Level & AP