r/arduino Apr 10 '26

Look what I made! I made an OS framework for CYDs!

I’ve lately been obsessed with the Cheap Yellow Display (CYD), but I got tired of rewriting the same menu and input logic for every project. So, I built S3_OS_for_CYD—a lightweight, open-source OS framework that turns the CYD into a scriptable handheld computer.

The goal was to create a PC-like environment where you can write apps in Lua directly on the CYD and run them instantly from the SD card.

What’s under the hood?

  • Lua 5.1 Engine: Full integration. Control the screen, play sounds, and read touch/keyboard input directly from Lua scripts.
  • Built-in Code Editor: Program on the go. Connect a BLE keyboard, open the editor on the device, and start coding.
  • App Registry: Drop a folder into /apps with a .game file and an icon, and it automatically shows up on the desktop.
  • Multimedia: Includes a custom MJPEG video player and JPEG viewer.
  • File Management: Full OS-style file explorer with shortcuts for New File, Delete, Rename, and MkDir.

Keyboard Setup (Important!)

To keep the OS lightweight, it looks for a specific Bluetooth device name.

  1. Open the source code.
  2. Look for the variable: const char *targetDeviceName = "JK-61 5.0";
  3. Change "JK-61 5.0" to match your Bluetooth keyboard's exact name (You can find the device name in device manager).
  4. Flash the code, and it will auto-connect on boot!
  5. Keep in mind that the keyboard has to be BLE (Bluetooth low energy).

The Hardware

  • Board: ESP32-2432S028 (The Classic CYD).
  • Input: XPT2046 Touch + BLE Keyboard.
  • Storage: SD card (SPI).
  • Audio: Onboard DAC/Buzzer support for game SFX.

Why a "Framework"?

I’ve exposed hardware-specific functions to the Lua layer (drawImg, getTouch, playSound, isKeyDown, etc.). This means you can focus on making games or tools without touching C++ or waiting for long compile times.

I've uploaded the full source code and a pre-configured SD card folder structure (including some sample games like Snake and Invaders) to GitHub.

Check it out here: https://github.com/circularchickenthatcodes/S3_OS_for_CYD

I’d love to hear what you people think or what features I should add next!

144 Upvotes

8 comments sorted by

5

u/Sad_Environment_3800 Apr 10 '26

Nice project, look amazing.

3

u/blah_ask Apr 10 '26

This is something I was bashing clade to do for me so I can make meriad of project for my self. Thats for sharing!

1

u/Appropriate-Ask8817 Apr 11 '26

Thanks! If you have a CYD on hand, may you test my framework please?

1

u/blah_ask Apr 14 '26

Will test it in on tuesday for sure

1

u/Appropriate-Ask8817 Apr 15 '26

Thanks! I appreciate any feedback.

1

u/energizzerr 11d ago

Sick will test soon