Built-in project · ESP32-C3-DevKitM-1
ESP32-C3 serial
The board on its own, printing its uptime once a second on UART0 and echoing anything typed into the serial monitor. The whole build, an ESP32-C3, runs here in your browser on the firmware below; open it in the editor to change the wiring or the code and run it again.
Runs in your browser. Free, and no account needed.
Click to open it in the editor
The circuit itself, running here on the simulator. Press what can be pressed; click anything else to open it in the editor.
The code
The firmware exactly as the editor opens it. Change a line there and press Run: it compiles in the browser.
sketch.ino · ESP32-C3-DevKitM-1
// Serial: print once a second, echo what arrives.
//
// Serial is UART0, which is the board's channel to the serial monitor at the
// bottom of the window. Type into the monitor and the characters come back
// with a prefix.
//
// Serial.print blocks while the 128-byte transmit FIFO is full, so a long
// line costs simulated time at the configured baud rate, exactly as it would
// on the real board.
unsigned long lastReport = 0;
void setup() {
Serial.begin(115200);
Serial.println("Mokxi ESP32-C3: serial example");
Serial.print("pi to five places is ");
Serial.println(3.14159265, 5);
}
void loop() {
unsigned long now = millis();
if (now - lastReport >= 1000) {
lastReport = now;
Serial.print("up ");
Serial.print(now);
Serial.println(" ms");
}
while (Serial.available() > 0) {
int c = Serial.read();
if (c == '\r') {
continue;
}
Serial.print("you typed: ");
if (c == '\n') {
Serial.println("<newline>");
} else {
Serial.print((char)c);
Serial.print(" (0x");
Serial.print(c, HEX);
Serial.println(")");
}
}
}
Parts list
2 parts, plus the jumper wires. Every one is in the editor's parts bin.
Change it and keep it
Open it in the editor, change the circuit or the code, and keep your version in a free account.