All tutorials

5 · Communication & data

Control the board from the keyboard

Intermediate18 min

Goal

Switch the LED on/off with the “on” and “off” commands.

Why it matters

Parsing a text command is already writing a protocol.

Steps

  1. 01Serial.begin(9600).
  2. 02Test Serial.available(), then read the line.
  3. 03Compare the received command and act on it.
  4. 04Send back an acknowledgement.

This tutorial runs inside the Circuitly simulator: your wiring and your code are checked automatically at every step.

Next tutorials