Built-in project · Cheap Yellow Display (ESP32-2432S028R)

CYD hello

The Cheap Yellow Display writes on its own 2.8 inch screen with TFT_eSPI, set up as the board is wired, and cycles its RGB LED. The whole build, a Cheap Yellow Display, 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.

Teaching? Assign it to your class in one click.

Beginner Runs in your browser. Free, and no account needed.

The parts retail for about $14. On Mokxi they're free.

CYD hello · Cheap Yellow Display (ESP32-2432S028R)live0.000 s 0.00x
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 · Cheap Yellow Display (ESP32-2432S028R)
// Hello: the CYD's screen through TFT_eSPI, with the board's setup built in,
// and its RGB LED, each color lit LOW.

#include <TFT_eSPI.h>

TFT_eSPI tft = TFT_eSPI();

const int kRed = 4;
const int kGreen = 16;
const int kBlue = 17;

void setup()
{
    Serial.begin(115200);
    pinMode(kRed, OUTPUT);
    pinMode(kGreen, OUTPUT);
    pinMode(kBlue, OUTPUT);

    tft.init();
    tft.setRotation(1); // landscape, the way the board is usually held
    tft.fillScreen(TFT_BLACK);
    tft.setTextColor(TFT_YELLOW, TFT_BLACK);
    tft.drawCentreString("Hello, CYD!", 160, 30, 4);
    tft.setTextColor(TFT_WHITE, TFT_BLACK);
    tft.drawCentreString("ESP32-2432S028R", 160, 70, 2);
    tft.fillRect(40, 120, 80, 60, TFT_RED);
    tft.fillRect(120, 120, 80, 60, TFT_GREEN);
    tft.fillRect(200, 120, 80, 60, TFT_BLUE);
    Serial.println("Screen drawn.");
}

void loop()
{
    // Red, green, blue, each lit LOW in turn.
    const int pins[3] = {kRed, kGreen, kBlue};
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) digitalWrite(pins[j], j == i ? LOW : HIGH);
        tft.fillRect(40 + i * 80, 190, 80, 8, TFT_WHITE);
        delay(400);
        tft.fillRect(40 + i * 80, 190, 80, 8, TFT_BLACK);
    }
}

Parts list

1 part, plus the jumper wires. They retail for about $14; on Mokxi they're free.

Change it and keep it

Open it in the editor, change the circuit or the code, and keep your version in a free account.