Skip to main content
Version: FILS English

PicoPlay

PicoPlay is a hand-held retro game console with built-in multiplayer support.

info

Author: ȘtefΔƒnescu Andrei-Cezar

GitHub Project Link: https://github.com/UPB-PMRust-Students/project-andrewstephengames

Description

PicoPlay is a hand-held device which allows players to enjoy a multiplayer in a tiny retro package. Users can either choose to play a classic singleplayer game or the baked in multiplayer game called Retro Heroes. Multiplayer is done either among PicoPlay clients or between PicoPlay and web browser clients. To power the experience, a server binary is run on a cloud computer, which the players connect to.

Motivation

My motivation to embark upon this project came from some of my previous personal projects, which all have a retro theme (see [1] [2]. Since I got into programming because of my passion for retro games, I am motivated to build a device from the ground up that includes the best games that I've written over the years, and allows for a solid platform for any future ports.

Architecture

Basic diagram

Basic diagram

Main components used:

  1. Raspberry Pi Pico 2W

    • the platform that we use

    • Connections:

      • 5 buttons, one buzzer, one LED on GPIO

      • LCD touch screen on SPI

      • Game server on LAN (optional)

  2. GPIO components

    • Left button: GP18

    • OK button: GP19

    • Right button: GP20

    • Up button: GP21

    • Down button: GP22

    • Green LED boot indicator: GP16

    • Buzzer: GP17

  3. Touch screen module

    • 2.8" LCD module with the ILI9341 controller: SPI

Log​

Week 5 - 11 May​

During this week I've wired up and soldered most of the components, such as the screen and buttons. Other than that, I worked on a side-project for the Students Scientific Communications Session, which helped me learn how to do multiplayer in Rust.

Week 12 - 18 May​

During this week I prepared for the hardware milestone by checking my electronic connections and finding several bad connections for SPI, which I've fixed, both physically and in the electric schematic below.

Week 19 - 25 May​

In the final week I've done most of the programming. I've written a quick and dirty server for Retro Heroes, and I designed a menu for the console. My controllers unfortunately borked this week, so I had to do the programming in the embedded_graphics_simulator until I could get new ones.

Once I solved my hardware fault. I went to work by porting the Retro Heroes client to the console. I made several stylistic changes, in order to account for the different form factor, different controls and limitations with embedded graphics, however the underlying client works the same as the web client.

Hardware​

The hardware consists of the Raspberry Pi Pico 2W microcontroller and various peripherals connected to it.

There are five buttons connected that control the graphical interface: Left, Ok, Right, Up and Down. Also, a small green LED is attached, indicating the boot status of the board.

The most important peripherals attached are the ILI9341 touch screen module and the buzzer, which allow for an embedded game development platform. Every single peripheral is attached via GPIO, except for the screen, which communicates with the board via SPI. On the screen we draw a menu, allowing the user to select from a list of games to play. Details can be seen in the figures below.

Figure 1

Top-down view of the hardware

Figure 2

Side view of the hardware

Schematics​

Electrical schematic

Electrical schematic

Bill of Materials​

DeviceUsagePrice
Raspberry Pi Pico 2WThe microcontroller39.66 RON
2.8" SPI LCD Module with ILI9341 Controller (240 x 320 px)Displaying graphics69.99 RON
Passive BuzzerBuzzer0.99 RON
4x Red Button with Round CoverButton7.96 RON
Blue Button with Round CoverButton1.99 RON
Plusivo 3 mm and 5 mm Diffused LED Light Emitting Diode Assortment KitLEDs and resistors26.99 RON
2x 20 cm 10p Male-Female WiresMale to female wires7.98 RON
10 cm 40p Male-Male WiresMale to male wires4.99 RON

Software​

LibraryDescriptionUsage
embassy-rpThe embassy embedded frameworkInitializing and interacting with peripherals
embassy-executorAn async/await executor designed for embedded usageAsynchronous programming
embassy-timeTimekeeping, delays and timeouts.Delays
embassy-syncSynchronization primitives and data structures with async supportSynchronizing tasks
ili9341ILI9341 display driverControlling the display
embedded-graphics2D graphics library that is focused on memory constrained embedded devicesDrawing graphics without using any buffers
embedded-hal-asyncAn asynchronous Hardware Abstraction Layer (HAL) for embedded systemsAsynchronous hardware access
gpioGPIO managementControlling GPIO pins
pwmPWM moduleControlling the buzzer and the intensity of the boot LED
embassy_lab_utilsEmbassy lab libraryLab code for networking
cyw43cyw43 wireless chipWireless driver
heaplessheaplessNo std strings
rand_corerand_coreRandom with no std
biski64biski64 randomizerLibrary to interface with rand_core
  1. Retro Heroes
  2. Pixper
  3. PicoPlay console demo