This project is a fully self-hosted Tetris game that runs entirely on a WIZnet Pico board like the W6300-EVB-Pico2. It uses WebSocket over TCP to send real-time game data directly to a browser — no external server or PC is needed.
The game is served from flash memory using a lightweight HTTP server and WebSocket-like communication protocol. It's developed using the WIZnet-PICO-C SDK.
- 🕹️ Play Tetris directly from your embedded board via browser
- 🔌 Runs fully on the board without any external server
- 💡 Built-in HTTP server and WebSocket handler in C
- 🧠 Game logic written in C and exposed via JSON
- 📦 HTML + JavaScript embedded directly into firmware
- 🧰 Built using official WIZnet SDK (WIZnet-PICO-C)
examples/ └── tetris/ ├── tetris.c # Main entry point with network setup ├── http_server.c/.h # Lightweight HTTP/WebSocket handler ├── game/ │ └── tetris_logic.c/.h # Tetris logic and board update handling └── generated/ ├── index_html.h # HTML as C string └── tetris_js.h # JavaScript as C string
Clone and set up the SDK:
git clone https://github.com/WIZnet-ioNIC/WIZnet-PICO-C.git
cd WIZnet-PICO-C
Follow the SDK instructions to set up dependencies and toolchain (typically auto-installed via the VS Code extension).
2. Add the Tetris Example
Copy the entire tetris/ directory into WIZnet-PICO-C/examples/.
Then, open examples/CMakeLists.txt and add:
cmake
add_subdirectory(tetris)
3. Build
From the root directory of WIZnet-PICO-C:
mkdir build && cd build
cmake ..
ninja
Or use the VS Code build tasks if you're using the extension.
4. Flash
Flash the resulting .uf2 or .bin file to your WIZnet board using your preferred method (drag-and-drop for UF2, or via OpenOCD, etc.).
5. Play
Connect your board to your local network.
Open a browser and go to:
http://192.168.11.200/ (or the IP you configured in tetris.c)
Use your keyboard (arrow keys or WASD) to control the game.
🧩 Requirements
WIZnet Pico-compatible board (e.g., W6300-EVB-Pico2)
WIZnet-PICO-C
Modern web browser
No external web server needed