TinySkiff ESP32-S3 Lab · Day 12 of 30

Type to the board
hear it answer

Yesterday the board only talked. Today it listens. You upload a short sketch, type a message into Serial Monitor, and the ESP32-S3 reads what you sent and sends it right back — the same USB cable now carrying words in both directions.

About 15 minutesArduino firstMicroPython optionalNo wiring today
Agent assist code TSK-DAY12-SERIALRW

Hand this to an agent so it can pull the lesson packet and coach you step by step.

01 First, know the pieces

What you need

The same three things as yesterday — nothing to wire. Tap Define on anything unfamiliar; the answer opens as a field note you can read and dismiss without losing your place.

Official manual photo of the ESP32-S3 development board.
Manual photo

ESP32-S3 board

Now it reads your input as well as printing its own.

Official manual screenshot of the Arduino IDE interface.
Manual screenshot

Arduino IDE

Serial Monitor's input box is how you type to the board.

Official manual page showing an Arduino sketch and its Serial Monitor output.
Manual sketch

Official sketch

Sketch_07.2_SerialRW.ino

02 One action at a time

Build it

The whole day is upload, type, and read the reply. Tap each step as you go to keep your place — you can finish without opening a single field note.

0 / 6 done
  1. Plug the ESP32-S3 into your computer with a data-capable USB cable.

  2. In Arduino IDE, select your ESP32-S3 board and the port it appears on.

  3. Open Sketch_07.2_SerialRW.ino.

  4. Press Upload and wait for the IDE to say Done uploading.

  5. Open Serial Monitor, set the baud rate to 115200, and set the line ending to Newline.

  6. Type a word into the input box, press Enter, and watch the board echo it back.

The line runs both ways.

The board is reading your input and answering. Head to Test & debug to confirm the echo.

03 Read just enough code

Read the code

The sketch waits for you. When characters arrive it collects them into one message, tidies the ends, and prints that message back. Switch to MicroPython if you'd rather see the same idea in Python.

Sketch_07.2_SerialRW.ino
void loop() {
  if (Serial.available()) {
    inputString = Serial.readStringUntil('\n');
    inputString.trim();
    if (inputString.length() > 0) {
      stringComplete = true;
    }
  }

  if (stringComplete) {
    Serial.printf("inputString: %s\r\n", inputString.c_str());
    inputString = "";
    stringComplete = false;
  }
}
Serial.available()Checks whether you've sent any characters yet, so the board reads only when there's something waiting.
Serial.readStringUntil('\n')Gathers what you typed up to the Enter key into one complete message.
inputString.trim()Trims the stray newline and spaces off the ends so the echo is clean.
Serial.printf("inputString: %s\r\n", inputString.c_str())Sends your message straight back, then the sketch clears it and waits for the next one.

04 Understand, don't memorise

Listening as well as talking

Yesterday's cable only carried the board's voice out. The same wires carry your words back in; the sketch just has to check for them and read a full line.

Anything there

available()

The board asks whether you've sent characters before it tries to read.

Read a line

readStringUntil

It collects your characters up to the Enter key into one message.

Tidy it

trim()

Stray newline and spaces come off the ends so the message is clean.

Answer

print it back

The board sends your message straight back and waits for the next.

The loop checkread a lineanswer → wait

Why check before reading

Reading when nothing has arrived would just return empty. available() lets the board wait for real input instead.

What readStringUntil does

It gathers characters until the newline you send with Enter, so the board gets one whole message rather than single letters.

05 Know it worked

Test & debug

Success and recovery sit side by side, so you never have to go hunting when something looks off.

What you should see
Serial Monitor115200 baud
ESP32S3 initialization completed!Ready to receive data...(you type) helloinputString: hello

The start-up lines print once; after that, each line you send comes straight back prefixed with "inputString:".

If it doesn't
  • Nothing echoes back? Set the line ending to Newline so the board sees where your message ends.
  • Garbled characters? Set Serial Monitor to 115200 baud to match the sketch.
  • Blank monitor at start? Confirm the right board and port, then press the board's reset button.
  • Upload fails? Swap in a data-capable USB cable.

06 Make the idea yours

Try this: make it a real reply

Same working sketch, no wiring — change what the board says back. It fits inside today's 15 minutes.

Wrap the echo

Change the reply text so the board answers with something like You said: hello instead of the plain inputString: label.

React to a word

Add an if (inputString == "ping") check that answers pong — the first hint of a board that follows commands.

Logbook

07 Learn it with a hand on the tiller

Coach me through it

Every lesson ships with a code and a machine-readable packet, so an agent can guide you with full context.

Lesson code

TSK-DAY12-SERIALRW

How the agent should behave: keep it to upload-type-read, check board, port, cable, baud rate, and the Newline line ending before touching code, and explain available, readStringUntil, and trim on request.

Field note

Shortcut

Prompt copied