A handheld game console programmable with (Micro/Circuit)Python.

Similar projects worth following
Starting from
deshipu has 256 orders / 15 reviews
Ships from Zürich, CH

A small game console directly programmable in Python. I always wanted to make this, and after my work on #PewPew FeatherWing I finally decided that I'm ready.

The first version may be a bit of a stretch — I tried to make it as small as possible, fitting in the 5x5cm limit of PCB manufacturers, so that it will be cheap to make the PCBs. Using the cheap ST7735 TFT display, and a cheap ATSAMD21E chip. I also tried to put all the components on one side of the board.

Of course the hard part is writing a game library, and the actual games. There is already one simple platformer game written as a demo, and the software library is getting new features added as needed.

  • 1 × ST7735R 1.44" 14-pin TFT display
  • 6 × SKPMAPE010 tact switch
  • 1 × 2*4*3.5 tact switch
  • 1 × MK12C02 SPDT slide switch
  • 1 × DET402-G-1 speaker

View all 18 components

  • Underwhelming DMA

    deshipua day ago 0 comments

    I finally worked on an improvement that I long wanted to do to the _stage library, which is at the heart of µGame: make the communication with the display asynchronous by using DMA. This way I can have two buffers, and calculate the contents of one of them while the other one is being sent to the display.

    As a test I used the balls demo from the tutorial, but with all waiting for the next frame removed — so they move as fast as they can.

    Here is how it works before DMA:

    And here is how it works with DMA:

    As you can see, there is barely any perceptible difference at all!

    The code I wrote for this is pretty nasty and hacky, and after seeing this, I don't think I have the heart to clean it up and send it as a pull request — it's simply not worth it.

    However, I will keep an eye for other ways of improving the firmware.

    UPDATE: Yes, I made some more precise measurements as well. Running through 1000 frames of the animation took the DMA version 31.034s and the non-DMA version 32.699s. That is 32.22 fps with DMA and 30.58 fps without.

    UPDATE2: I did a second test, with full-screen updates this time. 159.08s for non-DMA, versus 148.708s for DMA. That's 6.28 fps versus 6.72 fps. Even with such a large amount of data, the difference is negligible compared to the time spent computing it.

  • CircuitPython 4.0 and Display Support

    deshipu04/11/2019 at 23:12 0 comments

    The upcoming CircuitPython 4.0 introduces, among other things, built-in support for displays. That means that when there is an error in your code, you will be able to see it right there on the screen, without having to connect to some gnarly serial ports. For now the built-in display code is slow — fast enough for displaying text, but not for games. So I went and modified my #Stage, a Tile and Sprite Engine library to coexist with the displayio support, to get the best of both world — console using displayio, and fast updates using stage.

    There are still some tweaks left to do, perhaps use of a smaller font, and I still need to resolve the audioio problems that appeared with CircuitPython 3.0, but there are already nice improvements.

    I also hope to see if I can use DMA to speed up display updates considerably.

  • Updated Firmware with CircuitPython 3.2.0

    deshipu09/30/2018 at 10:21 0 comments

    CircuitPython 3.2.0 has been released a while ago, and brings a lot of bug fixes and some performance improvements. It would be nice to use it for µGame. Unfortunately, it also had some changes in how audio is handled, and since that interacted with available memory in ways that made the example games not work, it required more work on my part than just rebasing the repository.

    However, I managed to work around the problems, and a new version of the firmware is now available at There is also a release of the Vacuum Invaders game specially updated for that version of firmware: The other example games, as well as the tutorial, should work without any changes.

    In order to upgrade your device, you need to download the .uf2 file, and copy it to the TRINKETBOOT disk that appears when you press the "reset" button (located next to the direction buttons) twice. Once the file is copied, the device will reboot with the new firmware in place.

  • Another 3D-printed Case

    deshipu06/21/2018 at 20:40 0 comments

    A while back @davedarko made a simple case for µGame and made it available on Thingiverse. Now there is more choice, as Jovan Maric created another case. This one works even if you already attached your battery.

    Link to the design:

  • µGame Turbo is no More

    deshipu05/28/2018 at 07:28 0 comments

    After working on research and design for the #µGame Turbo for several months, and after Adafruit has started to work on their own version of a game console for CircuitPython, I decided that the improvements are not really worth the extra price and work, and decided to come back and focus on regular µGame more.

    There will be no more hardware iterations (except perhaps a small update changing the USB port to one that is more friendly to the fabricators), but there is still a lot that can be done in firmware and in the libraries. In particular, I have some ideas that I want to try to speed up the screen updates and to make more memory available for the games.

    The CircuitPython 3.0 is coming, Beta0 version was just released last week, and I've been working a little bit to make sure that all the libraries for µGame work with it. Right now I'm struggling with a change in the API for AudioIO, which makes CircuitPython try to allocate an extra 512 bytes of RAM every time you try to play a sound. Obviously that fails randomly in any larger game, as there is simply no room for it. But I'm sure a solution can be found — in the worst case, I will switch to a different way of making sounds.

  • In Stock Again

    deshipu04/30/2018 at 15:09 2 comments

    The freshly assembled µGames arrived straight from @Makerfabs and you can again get them from Tindie — there is a link at the top of this page. I will also take a few to #Hackaday | Belgrade 2018 — you can let me know in advance if you want to save on the shipping costs. I am not sure yet what other meetups I will attend (Makerfaire Prague is a possibility, and Europython is pretty much settled).

  • µGame Turbo

    deshipu04/02/2018 at 13:01 0 comments

    I didn't mention this yet here, but I have started work on an improved (and more expensive) version of this device. I the good old style of 80s, I decided to call it #µGame Turbo (if there is going to be a third version, it will be Super µGame Turbo, of course). I'm still researching most things, but the goal is to mostly have a physically bigger screen (same resolution), more memory and better audio (better speaker, volume control, headphone jack). It should be software-compatible with the current µGame, though.

    I am not sure how that project will go, and whether I will be selling that new version of the device too — there are currently simply too many variables.

  • New Shipment Soon

    deshipu03/23/2018 at 18:37 0 comments

    I just asked @Makerfabs for a quote on a new batch of µGames to be produced, and if everything goes well, they will be in stock in a couple of weeks. Also, the 3.0 version of CircuitPython is coming soon, and there will be a firmware update. The new version has greatly improved memory management, so it should help a little. I also fixed a few small bugs, and I plan to finally add the build-in art assets, which should also help with memory somewhat.

    In the meantime, I started to work on #µGame Turbo, and I entered it in the Hackaday Prize. I am not yet entirely sure where I will take this project, the only thing I'm certain of is that I want to keep it compatible with the current µGame — so that all the people who bought it are not left with an obsolete device. The new version will have more memory, so hopefully you won't need to pre-compile your files anymore, and I want to try and make it have proper audio, with volume control and headphone jack, a physically bigger display, and better connectors for external stuff. It will probably be more expensive, too, so it's more like an alternative to µGame coexisting with it side-by-side rather than a replacement.

    Finally, I just started today some sketches for another handheld, a #CircuitPython Game Badge, which is supposed to be even more minimal than µGame. The goal here is to minimize the price and power consumption, so that it could be used as a conference badge, given out to all participants. It's not going to be compatible with µGame, though.

  • µGame on ESP8266 with MicroPython

    deshipu02/24/2018 at 14:43 0 comments

    The SAMD21 chip is great for its native USB and the way you can just copy files on it, but since it's relatively new, the development boards for it are rather pricey. Plus, it really has small RAM and slow SPI, which limits what kind of games you can make.

    For making your own µGame clone, the ESP8266 could be a much better choice. 90kB of RAM and 40MHz SPI communication with the display (the esp can do 80MHz, but the display can't) make it a perfect solution. The only problem is a somewhat convoluted way of getting files on it, using external tools, but I might be able to do something about that with #ESP8266 Dev Board with True USB if I'm lucky. So I set out to try the µGame software on the ESP8266.

    The first try was using the CircuitPython firmware for Adafruit HUZZAH. Since the original µGame runs CircuitPython. Unfortunately, turns out that the HUZZAH board has been a little bit neglected, and some things don't work as expected with the current version. In particular, I couldn't get SPI to work while also using GPIO12 as D/C pin. After some failed attempts at fixing it quickly, I decided to try the good old MicroPython again.

    To do that, however, I had to port my _stage tile and and sprite engine to MicroPython from CircuitPython. While the two versions are very similar to the user, they differ substantially in their internal file organization, so I spent a whole night on this. But the result is very good:

    I'm using a new version of the #D1 Mini X-Pad Shield here, and a standard ST7735 breakout module. The picture on the screen doesn't look good, because of lighting — sorry about that, I don't have access to a better environment at the moment.

    In any case, the Jumper Wire game seems to be working very well. The modified MicroPython sources are available at so you can give it a go yourself!

  • The First Case

    deshipu02/22/2018 at 20:56 0 comments

    While several people are working on 3D-printed cases for the µGame, @davedarko is the first to deliver! He designed a minimalist case that covers the battery on the back, but leaves the PCB exposed for perusal. Since his µGame already had a battery attached, he sent the design to Szymon Jakubiak for printing and testing. When all was confirmed working, he printed two of them in colors matching the prototypes, and sent them to me:

    They look pretty slick, if I can say so myself!

View all 52 project logs

Enjoy this project?



Dimitri wrote 09/27/2018 at 21:07 point

Is there a documentation for the ugame library and how to use it? the paragraph here is just blank:

  Are you sure? yes | no

Szaja wrote 09/07/2018 at 14:53 point

Is there a firmware version based on CircuitPython 3? Or even better - is it possible to compile one from CircuitPython source code?

  Are you sure? yes | no

deshipu wrote 09/07/2018 at 15:16 point

I'm still working on the version of firmware based on CircuitPython 3. The tests I did while it was developed worked fine, but there are several details that require some changes — in particular, the API for playing WAV files has changed, and that requires some work, which in turn changes the memory use and makes the Vacuum Invaders no longer fit...

TLDR: it's coming, but I can't promise when.

  Are you sure? yes | no

Cameron Blackwood wrote 07/19/2018 at 08:08 point

Im curious about the 4 debug pins on the back. They seem to be PA-14/15/16/28 on the chip. So these are just general purpose pins? Do you use them as a uart or i2c or something else? Ive just been pondering some cool uses for this with a bluetooth/wifi connection or some such.

  Are you sure? yes | no

deshipu wrote 07/19/2018 at 08:32 point

The debug pins are on the side — they are PA30 and PA31, for SWIM. The four pins on the back are just pins that I had free, so I broke them out just in case. I don't really have any use for them, but you could connect an accelerometer or some other sensor there, I suppose.

  Are you sure? yes | no

Hendra Kusumah wrote 06/08/2018 at 17:39 point

just bought an st7735 1.8 inch screen. Is it possible for me to build this using that screen and using esp8266/esp32 as the main microcontroller

  Are you sure? yes | no

deshipu wrote 06/08/2018 at 23:53 point

Yes, see

However, you will need to find some way of handling the buttons. I used a small additional microcontroller connected over i2c to check the buttons, you might find a better way.

  Are you sure? yes | no

Hendra Kusumah wrote 06/09/2018 at 19:33 point

You sir are an awesome hacker. The ugame and st775r library is working but the _stage module means I have to compile the micropython firmware by myself right? Sorry if I am asking too much, but do you have a compiled firmware of your esp8266? 

And Btw, I am finally order your X-pad shield in order to build this with an esp8266.

Thank You

  Are you sure? yes | no

deshipu wrote 06/09/2018 at 20:23 point

Yes, unfortunately the _stage module is not included in MicroPython by default, and you have to build your own firmware with it. Give it a try, and if you have problems with it, we can look for a different solution.

  Are you sure? yes | no

Hendra Kusumah wrote 06/10/2018 at 21:45 point

The only thing that makes avoiding building the firmware since I tinker with micropython is linux. Since my PC only have minimum RAM for virtualbox and compiling it on the Raspberry Pi is a real challenge. But it seems I have to give it a try then. Thanks for the suggestion 

  Are you sure? yes | no

deshipu wrote 06/10/2018 at 23:00 point

I suppose that sooner or later you will install Linux on your computer. There is no xtensa compiler for the ARM processors, as far as I know, so you may have problems with compiling on the Raspberry Pi.

  Are you sure? yes | no

fabian wrote 05/31/2018 at 09:49 point

czy da sie na tym odpalic Ruby?

czy ma to MMU jak kolwiek to nazwac tryb chroniony czy separacje procesow

  Are you sure? yes | no

deshipu wrote 05/31/2018 at 18:34 point

Nie, to jest ARM Cortex-M0 z 32kB RAM i zegarem 48MHz. CircuitPython chodzi na tym bezpośrednio, bez żadnego systemu operacyjnego, który by zarządzał procesami. Wielozadaniowość da się osiągnąć korutynami.

  Are you sure? yes | no

codemasterPL wrote 05/30/2018 at 12:33 point


can this be programmed with Arduino / C++ ?

  Are you sure? yes | no

deshipu wrote 05/30/2018 at 12:58 point

Yes, technically there is nothing preventing you from that. It uses the same microcontroller as Arduino Zero and many Adafruit boards, so the support is there. However, you will probably need to write your own board definition file (to expose the pins that are used for the screen, buttons and audio), and write or port the libraries for handling the screen and audio.

I was actually thinking about porting the Arduboy/Gamebuino libraries to it, however, there is only so much time I have, and I would rather focus on CircuitPython, as that's the unique feature of this device.

  Are you sure? yes | no

codemasterPL wrote 05/30/2018 at 15:30 point

the thing is i don't like the idea of that having some layer, i need barebones to code gfx library and the game engine itself - absolutely not based on python.

The console hardware is extremely cool (missing wifi only) - and i'm interested in coding C++ for that, so you say that's possible., that's very nice - as i am interested in building a real game engine for it in C++.

when you plug it into usb, is it becoming available as a serial port for Arduino IDE ? how is it programmed?

  Are you sure? yes | no

deshipu wrote 05/30/2018 at 15:40 point

If you press reset twice, that runs the bootloader, which makes a fake USB drive appear called "TRINKETBOOT" (because I used Adafruit's bootloader for that board). You just need to copy a .uf2 file to it to flash your firmware. You can generate an .uf2 file from a .hex file with uf2tool ( I think that Adafruit's Arduino board definitions for the M0 boards do all this for you, so you could use that as a base, and just change the pin definitions. You can see which pins are used for what here:

  Are you sure? yes | no

deshipu wrote 05/30/2018 at 15:49 point

Or you can just forget uf2 and flash the Arduino bootloader.

  Are you sure? yes | no

davedarko wrote 02/10/2018 at 21:57 point

  Are you sure? yes | no

deshipu wrote 02/10/2018 at 22:00 point


I wonder where they got the "10 games pre-installed" lie from, though.

  Are you sure? yes | no

davedarko wrote 02/11/2018 at 12:10 point

it says 10 game on the back of the pcb and in the title of the tindie product, I was about to ask why you've called it that way. Maybe @mickmake can issue a correction for the next one.

  Are you sure? yes | no

deshipu wrote 02/11/2018 at 12:22 point

It's the 10th version. I included the version in the name, because the firmware is not compatible between hardware versions (the pins changed).

  Are you sure? yes | no

davedarko wrote 02/11/2018 at 14:17 point

maybe uGame X gaming platform works better? or uGame10 gaming console kit

  Are you sure? yes | no

deshipu wrote 02/11/2018 at 21:59 point

Right, and put a fruit on it. Over my dead body.

  Are you sure? yes | no

davedarko wrote 02/11/2018 at 23:15 point

well it seems to confuse people :(

  Are you sure? yes | no

deshipu wrote 02/12/2018 at 00:18 point

I think that whatever I do, some people are going to be confused. And I think that this is fine. Confusion is a sign of learning — it means you are breaking the old patterns and discovering something new.

  Are you sure? yes | no

Frank Buss wrote 02/10/2018 at 17:04 point

I copied the files from to it, but get only a white screen on reset. Is this supposed to work on the ugame10?

  Are you sure? yes | no

deshipu wrote 02/10/2018 at 17:09 point

You are probably getting a MemoryError. Make sure you only copy the game.mpy and not — that game pushes the limits of program size, and only works as precompiled code. More information about troubleshooting is available at:

  Are you sure? yes | no

Frank Buss wrote 02/11/2018 at 04:44 point

There is no game.mpy in the repository. I tried to use the console with minicom, and I can see the Python repl and enter commands, but there is no error output. I tried the tutorial, but it didn't autostart the, only after reset (after I deleted all files and created a new And once the file was corrupt after reset. Once it autostarted, but then the file in the editor was invalid, because it mounted the file system again.
I'm using Debian Linux. Doesn't look like a good system so far for newbie users. Compare this to Arduino, which works out of the box.

  Are you sure? yes | no

deshipu wrote 02/11/2018 at 11:49 point

I can assure you this also works out of the box. I suspect you have corrupted the filesystem by unplugging or hard-resetting it while the files were still copying. Normally you wouldn't touch the reset button, it resets automatically. You can run fsck on it, or follow the troubleshooting link I gave earlier to fix it. To avoid it in the future, please unmount the drive before unplugging or hard-resetting the device, so that all the data can be safely copied. I will add a section about this to the user guide.

  Are you sure? yes | no

Jon Raymond wrote 01/31/2018 at 19:15 point

What bootloader are you using for the SAMD21E18?

  Are you sure? yes | no

deshipu wrote 01/31/2018 at 20:38 point

The UF2, just like all the other CircuitPython boards:

  Are you sure? yes | no

davedarko wrote 01/27/2018 at 09:12 point

Do the schematics contain a hacked footprint for the LCD? because the labels and connections absolutely don't fit together :D

great project, good luck with tindie and everything :)

  Are you sure? yes | no

deshipu wrote 01/27/2018 at 09:42 point

Yeah, there are several problems with the schematic. The labels on the amplifier are reversed too. I need to fix those at some point, but since it worked, I didn't have much incentive.

  Are you sure? yes | no

deshipu wrote 01/27/2018 at 10:28 point

I fixed the schematic and put in the repository.

  Are you sure? yes | no

davedarko wrote 01/27/2018 at 10:33 point

marvellous :)

  Are you sure? yes | no

MatejEusk wrote 12/27/2017 at 07:44 point

Czesc.Nice project.Can I buy 1x and make 3d printed case and buttons?Also I can do pixelart ,chipmusic...

  Are you sure? yes | no

deshipu wrote 12/29/2017 at 23:46 point

I will be selling them on Tindie soon, I will post here when that happens.

  Are you sure? yes | no

święty wrote 12/12/2017 at 17:47 point

Czy bedzie kiedys komunikacja? Dało by się zrobić kalendarz, notatnik (baza danych)

albo komunikacja z internetu

  Are you sure? yes | no

deshipu wrote 12/29/2017 at 23:45 point

Nie przewiduję w tej wersji żadnej komunikacji poza USB. Projekt jest wystarczająco trudny i bez tego. Być może przyszłe wersje będą miały jakąś możliwość komunikacji — BLE albo WiFi — zobaczymy co los przyniesie.

  Are you sure? yes | no

Jasper parker wrote 12/06/2017 at 01:15 point

This looks fantastic Radomir, very impressive project! Should be able to sell these on Seeed.

  Are you sure? yes | no

deshipu wrote 12/29/2017 at 23:43 point

Thanks, I will be selling them on Tindie soon. I contacted Seeed, but I find it very difficult to talk with them.

  Are you sure? yes | no

Makerfabs wrote 02/02/2018 at 03:52 point

i take this comment  approval of we makerfabs'  production service :)


  Are you sure? yes | no

deshipu wrote 02/02/2018 at 14:12 point

Yes, it was much easier and more professional to talk with Makerfabs, that's why I choose them in the end. Big thanks for helping me with this!

  Are you sure? yes | no

ia wrote 10/29/2017 at 16:17 point

is possible to programing it using SDL library?

  Are you sure? yes | no

deshipu wrote 10/29/2017 at 18:29 point

No, the microcontroller is much too small for that.

  Are you sure? yes | no

Malik Enes Şafak wrote 10/29/2017 at 15:26 point

Is your screen 160x128? You can use new gamebuino meta libraries (not published yet) for this console. Same screen resolution, same microcontroller. Also check Pokitto, Gamebuino and Arduboy libraries. They all open source and you can learn lot of thing from these consoles. I really like this idea. If you will sell or publish this console open source please let me know. I really like to get one. 

  Are you sure? yes | no

deshipu wrote 10/29/2017 at 18:34 point

Thank you. I will definitely look at their code once it becomes available — what I have so far are tricks I picked up from old platforms, like Gameboy or NES. I expect they will be using similar techniques.

I think that gamebouino libraries won't work for me, because while the display has similar resolution (128x128 for mine) and number of colors, it's connected differently — mine uses SPI, their is most likely connected using parallel protocol — otherwise they wouldn't be able to achieve the speed they are claiming.

I also really want this to be easily programmable in Python, and all the consoles you listed use C, which admittedly is easier performance-wise, but not in the speed of development.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates