Skip to content
MCU Atlas
Walkthrough

Your First Project on a Cheap Yellow Display

Unbox a Cheap Yellow Display and get a hello-touch demo running in Arduino IDE — libraries, pins and config for the ESP32-2432S028R, no prior ESP32 experience.

By · Published: 11/10/2026 · Updated: 11/18/2026

You've got a yellow board in a box and a screen that has never shown anything. In about thirty minutes this page takes you from unboxing to a touchscreen you can draw on with your fingernail — no soldering, no prior ESP32 experience, and no research beyond this page. Every version number and config line you need is right here.

This walkthrough assumes the ESP32-2432S028R, the 2.8-inch board the whole CYD community is built around [1]. Not sure that's the board in your hands? Jump to which Cheap Yellow Display you have — it decodes the model number on the back of your board in one table.

What you need

  • A Cheap Yellow Display (ESP32-2432S028R, our part page has buying links and specs) with a single micro-USB port — how to check that is the next section.

  • The micro-USB cable that came in the box (the CYD ships with one [2]); if you're supplying your own, it must be a data cable, not a charge-only one.

  • A computer running Windows, macOS or Linux.

  • About 30 minutes, plus a fingernail or the small stylus some listings include.

Step 1 — Check you have the right board

Turn the board over. The silkscreen on the back should read ESP32-2432S028R, and the bottom edge should carry exactly one micro-USB port [1] [3]. That single-port board is the original CYD: colours render correctly and every tutorial written for the board — including this one — works on it.

If your board has two ports (micro-USB and USB-C), it's the later "CYD2USB" revision: it works, but the colours come out inverted until you change one config line, and its USB-C port won't talk to USB-C-only setups [3]. Follow this walkthrough anyway — then apply the one-line fixes in the troubleshooting table below.

Nothing looks like either? You may have a CYD-family board (3.5", 4.3", capacitive touch…) — the variant buyer's guide identifies every board by model number, and the call-out box at the end of this page says what changes in each step.

Step 2 — Install the Arduino IDE

Download and install the Arduino IDE 2.3.10 (the current release at the time of writing) from arduino.cc/en/software [4]. The IDE is free. Any 2.3.x version works for this walkthrough; the exact steps below match the 2.3 interface.

Step 3 — Install the ESP32 board package

The Arduino IDE doesn't know about ESP32 boards out of the box. You add Espressif's board package once:

  1. In the IDE, open File → Preferences (on macOS: Arduino IDE → Settings).

  2. Paste this into Additional boards manager URLs — it's Espressif's official stable package index [5]:

    https://espressif.github.io/arduino-esp32/package_esp32_index.json
  3. Open Tools → Board → Boards Manager, search for esp32, and pick esp32 by Espressif Systems.

  4. Before clicking Install, open the version dropdown and select 2.0.17 — not the newest 3.x (3.3.12 as this page was written [17]). Here's why: the display library this walkthrough uses, TFT_eSPI, has its latest release (V2.5.43) written for the ESP32 core 2.x line; on core 3.x it needs modified library files to compile [6] [7]. Version 2.0.17 is the final, bug-fixed 2.x release [8] and is the pairing every CYD tutorial is tested against [1] [9]. A beginner on 3.x hits a wall of compile errors that this page would otherwise have to teach you to patch — so we pin the version that just works. (Curious about 3.x? It's fine once you know your way around; come back to it later.)

  5. Install, then restart the IDE.

  6. Set the board: Tools → Board → esp32 → ESP32 Dev Module. The CYD doesn't appear by name; "basically any ESP32 board" works and ESP32 Dev Module is the usual choice [2].

Step 4 — Install the two libraries

Open Tools → Manage Libraries (or the books icon on the left edge) and install:

LibraryAuthorVersion (current at writing)What it drives
TFT_eSPIBodmerV2.5.43 [6]The screen
XPT2046_TouchscreenPaul Stoffregenv1.4 [10]The resistive touchscreen

Search for each name, check the author matches, click Install. Two facts about these versions, both fetched from their official release pages at the time of writing: TFT_eSPI's latest tagged release is V2.5.43 [6], and XPT2046_Touchscreen's is v1.4 — the release that added begin(SPI) so the touch chip can sit on its own SPI port [10], which is exactly how the CYD wires it.

Step 5 — Tell TFT_eSPI about the CYD (the step everyone gets wrong)

TFT_eSPI doesn't know what pins your display uses until you edit its config file, User_Setup.h, inside the library. Skipping this step is the single most common reason a first CYD sketch fails to compile or shows a blank screen — the library's default is written for a different board.

  1. Download the CYD's ready-made config from the community project's repository: DisplayConfig/User_Setup.h [1] (use the Raw button to save the plain file).

  2. Find the library's own User_Setup.h:

    • Windows: Documents\Arduino\libraries\TFT_eSPI\User_Setup.h
    • macOS: ~/Documents/Arduino/libraries/TFT_eSPI/User_Setup.h
    • (Or in the IDE: File → Preferences → sketchbook location, then libraries/TFT_eSPI/.)
  3. Replace the library file's entire contents with the downloaded file. Save.

What you just installed — every line is from that file [1]:

#define ILI9341_2_DRIVER     // the CYD's display driver (the "_2" variant suits its panel)
#define TFT_WIDTH  240       // portrait resolution
#define TFT_HEIGHT 320
#define TFT_BL   21          // backlight pin, on when HIGH
#define TFT_MISO 12          // the screen's SPI pins
#define TFT_MOSI 13
#define TFT_SCLK 14
#define TFT_CS   15
#define TFT_DC    2
#define TFT_RST  -1          // reset tied to the board's reset line
#define USE_HSPI_PORT         // the screen sits on the ESP32's second SPI port
#define SPI_FREQUENCY 55000000

You never wire anything — those pins are already connected on the yellow PCB. The file just tells the library where they are.

Step 6 — The hello-touch sketch

Open File → New, delete the placeholder, and paste this. The sketch is ours; every pin number and calibration range in it is from the sources at the bottom of the page [1] [9] [11] [12].

#include <SPI.h>
#include <TFT_eSPI.h>
#include <XPT2046_Touchscreen.h>

// The touch chip (XPT2046) has its OWN SPI pins on the CYD —
// separate from the screen's, which TFT_eSPI already knows about.
#define XPT2046_IRQ  36
#define XPT2046_MOSI 32
#define XPT2046_MISO 39
#define XPT2046_CLK  25
#define XPT2046_CS   33

TFT_eSPI tft = TFT_eSPI();
SPIClass touchscreenSpi = SPIClass(VSPI);
XPT2046_Touchscreen touchscreen =
    XPT2046_Touchscreen(XPT2046_CS, XPT2046_IRQ);

#define SCREEN_WIDTH  320   // landscape
#define SCREEN_HEIGHT 240

void setup() {
  Serial.begin(115200);
  touchscreenSpi.begin(XPT2046_CLK, XPT2046_MISO,
                       XPT2046_MOSI, XPT2046_CS);
  touchscreen.begin(touchscreenSpi);
  // 3 matches landscape for most boards; if taps land mirrored or
  // upside-down, try 1, 2 or 4 — a known CYD quirk, not a fault [11].
  touchscreen.setRotation(3);

  tft.init();
  tft.setRotation(1);            // landscape, same way round as the touch values
  tft.fillScreen(TFT_BLACK);
  tft.setTextColor(TFT_YELLOW, TFT_BLACK);
  tft.setTextSize(2);
  tft.drawString("Hello, touch!", 12, 12);
  tft.setTextColor(TFT_WHITE, TFT_BLACK);
  tft.setTextSize(1);
  tft.drawString("Drag your fingernail across the screen", 12, 44);
}

void loop() {
  if (touchscreen.tirqTouched() && touchscreen.touched()) {
    TS_Point p = touchscreen.getPoint();
    // Calibration ranges from the CYD community tutorials [9];
    // see "Calibrate" below to fine-tune for your panel.
    int x = map(p.x, 200, 3700, 1, SCREEN_WIDTH);
    int y = map(p.y, 240, 3800, 1, SCREEN_HEIGHT);
    tft.fillCircle(x, y, 3, TFT_YELLOW);
    Serial.print("x="); Serial.print(x);
    Serial.print("  y="); Serial.print(y);
    Serial.print("  pressure="); Serial.println(p.z);
  }
}

Step 7 — Upload and touch

  1. Plug the CYD into your computer with the micro-USB cable. First plug-in may take a minute while the CH340 USB-serial chip's driver installs; if it doesn't appear in a port list at all, install the driver manually — SparkFun has a step-by-step CH340 guide for every OS [2] [13].

  2. Tools → Port → select the port that appeared (COM3 and up on Windows, /dev/ttyUSB* on Linux, usbserial/usbmodem on macOS).

  3. Click the right-arrow Upload button. "Connecting…" hanging forever? Two documented fixes: drop Tools → Upload Speed to 115200 [2], and hold the BOOT button (right side of the board) until uploading starts [5].

  4. Watch the screen: it clears to black, prints Hello, touch! in yellow, then — drag a fingernail (resistive screens ignore a flat fingertip [14]) across the glass and a yellow trail follows it. The Serial Monitor (Tools → Serial Monitor, 115200 baud) streams x=… y=… pressure=… numbers as you move.

That's the whole loop: screen, touch, code. Everything else the CYD community builds is this loop with better drawings.

When it doesn't work (it's nearly always config)

SymptomCauseFix
Blank/white screen, backlight onTFT_eSPI still has its default User_Setup.hRedo Step 5
Colours inverted (negative image)Two-port "CYD2USB" revisionUse the repo's CYD2USB User_Setup.h, or add #define TFT_INVERSION_ON to User_Setup.h, or call tft.invertDisplay(1); in code [3] [11]
Washed-out look on a two-port boardCYD2USB gamma quirkThe repo's documented gamma patch (three lines) [3]
Yellow trail mirrored or upside-down vs your fingerTouch rotationChange touchscreen.setRotation(3) to 1, 2 or 4 [11]
Trail offset from your finger by a centimetre+Panel needs calibrationRun the community calibration sketch, keep the numbers it prints [12]
USB-C port does nothing on a two-port boardCYD2USB USB-C port lacks CC resistorsIt's documented as not working with USB-C-to-USB-C cables — use the micro-USB port or a USB-C-to-USB-A adapter [3]
Sketch won't compile, SPI/esp32-hal errorsESP32 core 3.x installedBoards Manager → esp32 → version 2.0.17 (Step 3.4) [7] [8]
Upload never startsPort speed / boot modeUpload Speed 115200; hold BOOT [2] [5]

Calibrate (optional, five minutes)

The map(200, 3700) ranges above are the community's good-enough defaults [9]. Your panel's exact ranges differ slightly. To nail them, run Robert Fleming's CYD calibration sketch — it draws six crosshairs, you tap their centres, and it prints your board's true calibration values to keep for every future sketch [12].

Doing this on another CYD-family board

Everything above is for the single-port ESP32-2432S028R. On other boards the steps are identical — IDE, board package, libraries — but the config in Step 5 and the touch wiring change [15]:

  • ESP32-3248S035 (3.5") — a ST7796 driver at 320×480, not ILI9341 at 240×320: you cannot reuse the 2432S028 User_Setup.h verbatim [15]. The R version's resistive touch still uses an XPT2046, but on different pins; the C version's capacitive GT911 talks I²C on SDA 33 / SCL 32 instead, and its interrupt pin is tied to ground on some units, so touch is poll-only — a firmware detail, not a fault [15].

  • Two-port CYD2USB (still labelled ESP32-2432S028) — Step 5 config plus the colour-inversion and gamma fixes in the table above [3].

  • Dual-port boards with an ST7789 screen — some late revisions ship a different driver entirely: they need ST7789_DRIVER, BGR colour order and inversion off in User_Setup.h [15]. Check the driver marking before you fight it.

  • 4.3" ESP32-S3 boards (4827S043 / 8048S043) — different chip generation, USB-C and a parallel-RGB display: same IDE, but a different board definition and display approach altogether; the community maintains ready-made PlatformIO board files for every Sunton variant [16].

  • Freenove FNK0104 / FNK0104N (ESP32-S3 kits) — not Sunton boards, though Freenove's own listing calls them "CYD": same story again, the TFT_eSPI config differs and the capacitive screens need different touch code. Our FNK0104 vs CYD comparison says what changes and when the upgrade is worth it.

Unsure which one you have? The CYD family variants table identifies every board in the family, and the buyer's guide decodes your model number in one table. Our part pages collect variant details and buying links for the 2.8-inch ESP32-2432S028R and the 3.5-inch ESP32-3248S035.

Where to go next

  • More things to build: our Cheap Yellow Display community hub collects what people actually make on this board — clocks, dashboards, games — with the projects that inspired them.

  • The community repo: the ESP32-Cheap-Yellow-Display project this walkthrough borrows its config from keeps a gallery of examples, pinout docs and hardware mods [1].

  • Nicer UIs: once drawing dots feels dull, LVGL is the framework the community steps up to for phone-style interfaces — the calibration values you just collected carry straight over [12].

MCU Atlas is an independent site, not affiliated with Sunton or the ESP32-Cheap-Yellow-Display project. Thanks to that project's maintainers and to Random Nerd Tutorials, whose published pinouts and calibration values this walkthrough builds on.

Sources

  1. Brian Lough (witnessmenow), ESP32-Cheap-Yellow-Display — SETUP.md (board choice, upload speed, CH340 driver link), DisplayConfig/User_Setup.h (all Step 5 config lines). github.com/witnessmenow/ESP32-Cheap-Yellow-Display

  2. witnessmenow, SETUP.md — included cable, "ESP32 Dev Module", 115200 tip, SparkFun CH340 guide. github.com/witnessmenow/ESP32-Cheap-Yellow-Display/blob/main/SETUP.md

  3. witnessmenow, cyd.md — revision differences, inversion, gamma patch, USB-C CC resistors. github.com/witnessmenow/ESP32-Cheap-Yellow-Display/blob/main/cyd.md

  4. Arduino IDE release 2.3.10. github.com/arduino/arduino-ide/releases

  5. Espressif, Installing Arduino-ESP32 — boards manager URL, board/port selection, hold BOOT on upload. docs.espressif.com/projects/arduino-esp32/en/latest/installing.html

  6. Bodmer, TFT_eSPI release V2.5.43 (latest at writing). github.com/Bodmer/TFT_eSPI/releases

  7. TFT_eSPI on ESP32 core 3.x requires modified files — AndroidCrypto's documented fork note (tested against 3.0.7). github.com/AndroidCrypto/TFT_eSPI

  8. Espressif, arduino-esp32 release v2.0.17 — "bug fix release for Arduino ESP32 Core version 2.X.X". github.com/espressif/arduino-esp32/releases/tag/2.0.17

  9. Random Nerd Tutorials, Getting Started with the CYD — library installs, touch sketch pattern, map(200, 3700)/(240, 3800) calibration ranges. randomnerdtutorials.com/cheap-yellow-display-esp32-2432s028r/

  10. Paul Stoffregen, XPT2046_Touchscreen release v1.4 — adds begin(SPI). github.com/PaulStoffregen/XPT2046_Touchscreen/releases

  11. Random Nerd Tutorials, CYD touch button tutorial — setRotation note, TFT_INVERSION_ON fix. randomnerdtutorials.com/touchscreen-on-off-button-cheap-yellow-display-esp32-2432s028r/

  12. Random Nerd Tutorials, CYD resistive touchscreen calibration (Robert Fleming's sketch). randomnerdtutorials.com/esp32-cheap-yellow-display-cyd-resistive-touchscreen-calibration/

  13. SparkFun, How to Install CH340 Drivers. learn.sparkfun.com

  14. MCU Atlas CYD variant research sheet — resistive touch works with fingernail/stylus; variant facts in the call-out box. ops/reports/cyd-variant-research-2026-11-10.md §3

  15. Research sheet §2–§4, §7 — 3248S035 ST7796/GT911 pins and poll-only quirk, config not reusable verbatim, ST7789 clone fixes. (Primary sources therein: gin66, rzeldent, atomic14, lcdultrapro.)

  16. rzeldent, platformio-espressif32-sunton — board definitions for every Sunton variant. github.com/rzeldent/platformio-espressif32-sunton

  17. Espressif, arduino-esp32 release 3.3.12 (latest at writing). github.com/espressif/arduino-esp32/releases

Where to go next

More no-wiring builds like this one: the ESP32 beginner hub, and every beginner-rated build across boards at microcontroller projects for beginners.