🔌 Web Serial the browser talks to microcontrollers

Plug in an Arduino, ESP32, micro:bit, or anything with a USB-serial chip, click connect, pick the port, and you have a two-way byte stream between a web page and real hardware. This is how the official Arduino Cloud editor flashes boards — from a tab.

Chromium-only. No device? The sketch below makes any Arduino a 5-minute demo partner.

— serial monitor —\n
The 12-line Arduino sketch that pairs with this page
void setup() {
    Serial.begin(9600);
    pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
    if (Serial.available()) {
        String cmd = Serial.readStringUntil('\n');
        if (cmd == "on")  { digitalWrite(LED_BUILTIN, HIGH); Serial.println("LED on"); }
        if (cmd == "off") { digitalWrite(LED_BUILTIN, LOW);  Serial.println("LED off"); }
    }
}