# MakeCode Arcade with Raspberry Pi Zero

## What is MakeCode Arcade?

![](https://cdn-learn.adafruit.com/assets/assets/000/069/249/medium800/components_hero.png?1547258569)

[Microsoft MakeCode Arcade](https://arcade.makecode.com) is a **web-based** beginner-friendly code editor to create **retro arcade games** for the web and for microcontrollers. In this guide, you will learn how to assemble your own Arcade hardware from different parts. MakeCode Arcade is [open source on GitHub](https://github.com/microsoft/pxt-arcade).

#### **Arcade is for retro 2D sprite-based games**.

Arcade supports a 160x120 screen with 16 colors, and has a 2D game engine with sprites, platformer-style collisions, tile maps, particle systems and more!

![components_duck.gif](https://cdn-learn.adafruit.com/assets/assets/000/069/271/medium640thumb/components_duck.jpg?1547298908)

#### **Arcade is a web-based code editor.** &nbsp;

Just like the [MakeCode Circuit Playground Express](https://makecode.adafruit.com) editor, you can use blocks or JavaScript to build your program in your browser. Nothing to install - it just works!

![components_webpage.png](https://cdn-learn.adafruit.com/assets/assets/000/069/252/medium640/components_webpage.png?1547259575)

#### **Arcade is friendly to beginners!** &nbsp;

Get started with building your own retro games, using the block editor and the many guides. You don't need to be a programmer to get started!

![components_freindly.png](https://cdn-learn.adafruit.com/assets/assets/000/069/253/medium640/components_freindly.png?1547259716)

#### **Arcade is friendly to seasoned programmers too!**

Switch to JavaScript and type away. MakeCode supports [**Static TypeScript**](https://makecode.com/language), a special flavor of JavaScript optimized for compilation on micro-controllers.

![components_javascript.png](https://cdn-learn.adafruit.com/assets/assets/000/069/254/medium640/components_javascript.png?1547259792)

#### **Arcade runs on hardware (in particular SAMD51)!&nbsp;**

While all games can be shared and played via the web, the fun starts when you compile them for SAMD51-based boards, like the **Adafruit ItsyBitsy M4 Express**.

![components_vlcsnap-2019-01-12-05h25m38s411.png](https://cdn-learn.adafruit.com/assets/assets/000/069/274/medium640/components_vlcsnap-2019-01-12-05h25m38s411.png?1547299573)

[Open MakeCode Arcade](https://arcade.makecode.com/)
# MakeCode Arcade with Raspberry Pi Zero

## Setup

This guide will show you how to build a MakeCode Arcade from a Raspberry Pi Zero or Pi 3A+. If you are looking for Adafruit M4 boards, try [this guide](https://learn.adafruit.com/makecode-arcade-with-samd51-m4).
## Raspberry Pi Zero setup

* a Raspberry Pi Zero (we won't be using WiFi, but it's fine to buy the Pi Zero W if you want)
* a HDMI to mini-HDMI cable or converter
* a microUSB cable
* a micro SD card (capacity and speed don't matter much)

If you want to get all in a single kit, get the budget packet. If you don't feel like soldering, get the **Pi with headers**.


### Raspberry Pi Zero W Budget Pack - Includes Pi Zero W

[Raspberry Pi Zero W Budget Pack - Includes Pi Zero W](https://www.adafruit.com/product/3410)
Remember those cereal commercials that would always say,&nbsp;"part of a complete breakfast"? Well the Pi Zero's a lot like that bowl of cereal - while it's great&nbsp;on its own, you&nbsp;need a lot of accessories to make it a complete meal.

The **Pi Zero W...**

Out of Stock
[Buy Now](https://www.adafruit.com/product/3410)
[Related Guides to the Product](https://learn.adafruit.com/products/3410/guides)
![Raspberry Pi Zero, micro SD card, cables, headers and case](https://cdn-shop.adafruit.com/640x480/3410-02.jpg)

### Raspberry Pi Zero WH (Zero W with Headers)

[Raspberry Pi Zero WH (Zero W with Headers)](https://www.adafruit.com/product/3708)
If you didn't think that the Raspberry Pi Zero W could possibly get any better, then boy do we have a pleasant surprise for you!&nbsp;The new **Raspberry Pi Zero WH&nbsp;** offers all the benefits of the Pi Zero W, but with one big difference – a **pre-soldered GPIO...**

Out of Stock
[Buy Now](https://www.adafruit.com/product/3708)
[Related Guides to the Product](https://learn.adafruit.com/products/3708/guides)
![Angled shot of Raspberry Pi Zero W computer with headers.](https://cdn-shop.adafruit.com/640x480/3708-00.jpg)

### Raspberry Pi Zero - Version 1.3

[Raspberry Pi Zero - Version 1.3](https://www.adafruit.com/product/2885)
At first glance, the Pi Zero isn't much. &nbsp;It just looks like a slimmed down version of the Raspberry Pi we know and love. &nbsp;But when we started to think of the possibilities - [and what a well-chosen set of accessories could add](https://www.adafruit.com/product/2816) -...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2885)
[Related Guides to the Product](https://learn.adafruit.com/products/2885/guides)
![Angled shot of Raspberry Pi Zero computer](https://cdn-shop.adafruit.com/640x480/2885-06.jpg)

## Raspberry Pi 3A+ setup

You can use Pi 3A+ instead of Pi Zero. It always comes with headers and you don't need a HDMI to mini-HDMI cable. On the other hand, you will need USB-A to USB-A cable.


### Raspberry Pi Model 3 A+

[Raspberry Pi Model 3 A+](https://www.adafruit.com/product/4027)
The **Raspberry Pi 3 Model A+** is the latest board for the minimalist Pi fan. Like the [Raspberry Pi 3 Model B+](https://www.adafruit.com/product/3775), it boasts a 64-bit quad core processor running at 1.4 GHz, dual-band 2.4 GHz and 5 GHz wireless LAN, and...

In Stock
[Buy Now](https://www.adafruit.com/product/4027)
[Related Guides to the Product](https://learn.adafruit.com/products/4027/guides)
![Angled shot of Raspberry Pi Model 3 A+](https://cdn-shop.adafruit.com/640x480/4027-02.jpg)

## Controls

MakeCode Arcade uses 7 buttons. There are many options for buttons:

* **Adafruit Joy Bonnet** and likely a plastic case for Pi Zero
* **Arcade Cabinet**
* random buttons and joystick that you wire up together

You can also get **Joy Bonnect Pack with Pi Zero** which includes many of the components.




### Adafruit Joy Bonnet for Raspberry Pi

[Adafruit Joy Bonnet for Raspberry Pi](https://www.adafruit.com/product/3464)
Pocket-sized fun is the name of this game, with the **Joy Bonnet** &nbsp;–&nbsp;our most fun Bonnet ever (no, we didn't even think that was possible, either!). This Bonnet fits perfectly on top of your Raspberry Pi Zero (any kind) and gives you adorable hand-held arcade...

In Stock
[Buy Now](https://www.adafruit.com/product/3464)
[Related Guides to the Product](https://learn.adafruit.com/products/3464/guides)
![Video of a white hand playing a DIY gaming console on a small monitor.](https://cdn-shop.adafruit.com/product-videos/640x480/3464-07.jpg)

### Raspberry Pi Arcade Cabinet Pack

[Raspberry Pi Arcade Cabinet Pack](https://www.adafruit.com/product/3272)
Couldn't get one of those Nintendo Mini Classic consoles? No problem, we've got you covered with this **no-solder no-tools** required kit! Video games are one of the most popular applications for the Raspberry Pi (and one of the best gifts to get over the holidays). Play...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3272)
[Related Guides to the Product](https://learn.adafruit.com/products/3272/guides)
![An assembled Raspberry Pi Arcade Cabinet Pack. ](https://cdn-shop.adafruit.com/640x480/3272-03.jpg)

### Arcade Button - 30mm Translucent Blue

[Arcade Button - 30mm Translucent Blue](https://www.adafruit.com/product/476)
A button is a button, and a switch is a switch, but these translucent arcade buttons are in a class of their own. They're the same size as common arcade controls (often referred to as 30mm diameter) but have some nice things going for them that justify the extra dollar.  
  
First,...

In Stock
[Buy Now](https://www.adafruit.com/product/476)
[Related Guides to the Product](https://learn.adafruit.com/products/476/guides)
![Angled shot of a translucent blue round 30mm arcade button. ](https://cdn-shop.adafruit.com/640x480/476-00.jpg)

# MakeCode Arcade with Raspberry Pi Zero

## Firmware

## Firmware

If your SD card comes with files on it, delete them, or just format the SD card as FAT32. **Do not** format as ExFAT. Then download the ZIP file below, unzip it, and copy all files to the root directory of the SD card.

After this, if your SD card drive is named `D:`, then there should be file `D:\9.0.3.gz`, and if your SD card is called `/Volumes/NO NAME`, then you should have `/Volumes/NO NAME/9.0.3.gz`. There should **not** be an `arcade` folder on the SD card. The ZIP below contains binaries built from https://github.com/microsoft/uf2-linux and https://github.com/microsoft/pxt-arcade-cabinet-menu

If you want to use Raspberry Pi Zero with Joy Bonnet, use the first file below. If you're building your own arcade with your own buttons and Pi Zero, use the second file.

If you want to use Raspberry Pi 3A+ (other models like 3B or 4 will not work), use the third file. It's setup for custom input by default, but if you want to use it with Joy Bonnet, just copy `arcade.cfg` file from the first zip over to your SD card.

[arcade-joy-bonnet.zip](https://cdn-learn.adafruit.com/assets/assets/000/084/626/original/arcade-joy-bonnet.zip?1574211210)
[arcade-cardboard.zip](https://cdn-learn.adafruit.com/assets/assets/000/084/627/original/arcade-cardboard.zip?1574211225)
[arcade-cardboard-rpi-3a-plus.zip](https://cdn-learn.adafruit.com/assets/assets/000/085/719/original/arcade-cardboard-rpi-3a-plus.zip?1576103869)
Yellow: This guide only covers using the Raspberry Pi Zero or the Raspberry Pi 3A+. If you are looking to use another model of Pi, please look for another guide.

## Joy Bonnet

If you're using the Joy Bonnet, then congratulations, you're done!

Just connect the Pi using HDMI cable to a screen, and using the MicroUSB cable to the computer. After a few seconds you should see a menu much like the one below. Move to the next section to download games to your Arcade.

![](https://cdn-learn.adafruit.com/assets/assets/000/084/629/medium800/gaming_arcade-menu-2_%281%29.png?1574211556)

## Custom Inputs

If you want to use a big joystick and buttons, it's quite easy!

### Using standard connection

When you load up the `arcade-cardboard.zip` on your Pi, it will show you pinout to follow. You would generally connect buttons one by one, and see which one you have connected by looking at the screen. Then you know which cable you've got, and you move it to the right pin.

Once you're done connecting everything, press ABABAB and the configuration program will be replaced by the game menu program. This will be persisted after reset.

### Using custom connections

The other option is to connect the buttons as you like and then tell your Pi where the buttons are connected. This is done by editing `arcade.cfg` file on the SD card.

If you have the Arcade Cabinet Pack, follow the [assembly guide](https://learn.adafruit.com/retro-gaming-with-raspberry-pi/arcade-cabinet-pack-assembly). If you plug in the buttons the way it's described in there, you will need the following in the `arcade.cfg` file:

``BTN_A=4
BTN_B=25
BTN_RESET=11
BTN_EXIT=5
BTN_MENU=16
BTN_LEFT=10
BTN_RIGHT=22
BTN_UP=23
BTN_DOWN=27``

If you are building a custom player arcade cabinet (1 or 2 players),

``BTN_RESET=4
BTN_EXIT=3
BTN_MENU=2
BTN_A=26
BTN_B=19
BTN_LEFT=13
BTN_UP=6
BTN_RIGHT=5
BTN_DOWN=0
BTN_A2=11
BTN_B2=9
BTN_LEFT2=10
BTN_UP2=22
BTN_RIGHT2=27
BTN_DOWN2=17``

Feel free to connect them differently, just  [follow these instructions](https://learn.adafruit.com/retro-gaming-with-raspberry-pi/adding-controls-hardware) and update the file with the right GPIO numbers.


# MakeCode Arcade with Raspberry Pi Zero

## Downloading Games

## Adding games

To add new games head to https://arcade.makecode.com !

Once you have created your game, 
* Press the **Download** button and say you don't want to pair anything if asked. You should then be given options to select type of board. 
* Select Raspberry Pi (it will have the image of the menu above). This should create a file named `arcacde-something.uf2`. 
* Copy it to `ARCADE` drive that should be visible on the computer to which your Pi is connected with the USB cable.

If the `ARCADE` drive doesn't show up, make sure the USB cable is plugged into the USB port on the Pi that is closer to the HDMI port. The other one is power-only. If using a case, make sure it's plugged all the way in.

# MakeCode Arcade with Raspberry Pi Zero

## Sharing Games

There are plenty of ways to share games with your friends, family and anyone else who you think might enjoy something you've created!

Let's quickly go over a few of your options.

### Online page

Click on the **Share** button and follow the steps to upload a version of your game online. It will generate a URL for you.

&nbsp;

Anyone with the generated URL will be able to play in a full screen mode, or edit your game! They'll also be able to download it onto their own Arcade if they have one.

&nbsp;

This page supports oEmbed and other various embedding options.

![components_share.png](https://cdn-learn.adafruit.com/assets/assets/000/069/281/medium640/components_share.png?1547307183)

![components_sharedialog.png](https://cdn-learn.adafruit.com/assets/assets/000/069/282/medium640/components_sharedialog.png?1547307249)

![components_embed.png](https://cdn-learn.adafruit.com/assets/assets/000/069/283/medium640/components_embed.png?1547307576)

### Save into an image

Click the disk icon will save your code into a PNG image. You can import the image back or simply drag and drop it into the editor to reload the code.

&nbsp;

The image below contains the **falling duck** game.

![components_save.png](https://cdn-learn.adafruit.com/assets/assets/000/069/286/medium640/components_save.png?1547307874)

![](https://cdn-learn.adafruit.com/assets/assets/000/069/287/medium800/components_arcade-falling-duck_%281%29.png?1547307938)

Info: 

## Downloaded .UF2 files

Downloaded .uf2 files also contain the game code. You can import them or drag and drop them into the editor to reload the code.

## GitHub repo

You can also use GitHub repositories to store and share your code. This is particularily useful if you end up building a lot of code or if you want to share an extension with other users. Read all about getting started with GitHub at https://makecode.com/extensions/github-authoring .


## Guide Products

### Raspberry Pi Zero W Budget Pack - Includes Pi Zero W

[Raspberry Pi Zero W Budget Pack - Includes Pi Zero W](https://www.adafruit.com/product/3410)
Remember those cereal commercials that would always say,&nbsp;"part of a complete breakfast"? Well the Pi Zero's a lot like that bowl of cereal - while it's great&nbsp;on its own, you&nbsp;need a lot of accessories to make it a complete meal.

The **Pi Zero W...**

Out of Stock
[Buy Now](https://www.adafruit.com/product/3410)
[Related Guides to the Product](https://learn.adafruit.com/products/3410/guides)
### Raspberry Pi Zero WH (Zero W with Headers)

[Raspberry Pi Zero WH (Zero W with Headers)](https://www.adafruit.com/product/3708)
If you didn't think that the Raspberry Pi Zero W could possibly get any better, then boy do we have a pleasant surprise for you!&nbsp;The new **Raspberry Pi Zero WH&nbsp;** offers all the benefits of the Pi Zero W, but with one big difference – a **pre-soldered GPIO...**

Out of Stock
[Buy Now](https://www.adafruit.com/product/3708)
[Related Guides to the Product](https://learn.adafruit.com/products/3708/guides)
### Raspberry Pi Zero - Version 1.3

[Raspberry Pi Zero - Version 1.3](https://www.adafruit.com/product/2885)
At first glance, the Pi Zero isn't much. &nbsp;It just looks like a slimmed down version of the Raspberry Pi we know and love. &nbsp;But when we started to think of the possibilities - [and what a well-chosen set of accessories could add](https://www.adafruit.com/product/2816) -...

Out of Stock
[Buy Now](https://www.adafruit.com/product/2885)
[Related Guides to the Product](https://learn.adafruit.com/products/2885/guides)
### Raspberry Pi Model 3 A+

[Raspberry Pi Model 3 A+](https://www.adafruit.com/product/4027)
The **Raspberry Pi 3 Model A+** is the latest board for the minimalist Pi fan. Like the [Raspberry Pi 3 Model B+](https://www.adafruit.com/product/3775), it boasts a 64-bit quad core processor running at 1.4 GHz, dual-band 2.4 GHz and 5 GHz wireless LAN, and...

In Stock
[Buy Now](https://www.adafruit.com/product/4027)
[Related Guides to the Product](https://learn.adafruit.com/products/4027/guides)
### Adafruit Joy Bonnet for Raspberry Pi

[Adafruit Joy Bonnet for Raspberry Pi](https://www.adafruit.com/product/3464)
Pocket-sized fun is the name of this game, with the **Joy Bonnet** &nbsp;–&nbsp;our most fun Bonnet ever (no, we didn't even think that was possible, either!). This Bonnet fits perfectly on top of your Raspberry Pi Zero (any kind) and gives you adorable hand-held arcade...

In Stock
[Buy Now](https://www.adafruit.com/product/3464)
[Related Guides to the Product](https://learn.adafruit.com/products/3464/guides)
### Joy Bonnet Pack for Raspberry Pi Zero - Includes Pi Zero W

[Joy Bonnet Pack for Raspberry Pi Zero - Includes Pi Zero W](https://www.adafruit.com/product/3205)
The **Joy Bonnet Pack for Raspberry Pi Zero W** sets you up with the [Pi Zero W](https://www.adafruit.com/product/3400), and our [Joy Bonnet](https://www.adafruit.com/product/3464) **&nbsp;-&nbsp;** our most fun Bonnet ever!&nbsp;This Bonnet fits...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/3205)
[Related Guides to the Product](https://learn.adafruit.com/products/3205/guides)
### Raspberry Pi Arcade Cabinet Pack

[Raspberry Pi Arcade Cabinet Pack](https://www.adafruit.com/product/3272)
Couldn't get one of those Nintendo Mini Classic consoles? No problem, we've got you covered with this **no-solder no-tools** required kit! Video games are one of the most popular applications for the Raspberry Pi (and one of the best gifts to get over the holidays). Play...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3272)
[Related Guides to the Product](https://learn.adafruit.com/products/3272/guides)
### Arcade Button - 30mm Translucent Blue

[Arcade Button - 30mm Translucent Blue](https://www.adafruit.com/product/476)
A button is a button, and a switch is a switch, but these translucent arcade buttons are in a class of their own. They're the same size as common arcade controls (often referred to as 30mm diameter) but have some nice things going for them that justify the extra dollar.  
  
First,...

In Stock
[Buy Now](https://www.adafruit.com/product/476)
[Related Guides to the Product](https://learn.adafruit.com/products/476/guides)

## Related Guides

- [Using the RockBLOCK Iridium Modem](https://learn.adafruit.com/using-the-rockblock-iridium-modem.md)
- [reef-pi Guide 1: Setup and Demonstration](https://learn.adafruit.com/reef-pi-installation-and-configuration.md)
- [NES Cart RetroPie Game Console](https://learn.adafruit.com/nes-cart-retropie.md)
- [Pi Hole Ad Blocker with Pi Zero W](https://learn.adafruit.com/pi-hole-ad-blocker-with-pi-zero-w.md)
- [Motion Controlled Matrix Bed Clock](https://learn.adafruit.com/motion-controlled-matrix-bed-clock.md)
- [LoRa and LoRaWAN Radio for Raspberry Pi](https://learn.adafruit.com/lora-and-lorawan-radio-for-raspberry-pi.md)
- [Retro Gaming with Raspberry Pi](https://learn.adafruit.com/retro-gaming-with-raspberry-pi.md)
- [Feather + Raspberry Pi Weather Monitoring Network with LoRa or LoRaWAN](https://learn.adafruit.com/multi-device-lora-temperature-network.md)
- [Android GBoard Morse Code Control with Circuit Playground Express](https://learn.adafruit.com/android-gboard-morse-code-at-with-circuitplayground-express.md)
- [reef-pi Guide 7: Dosing Controller](https://learn.adafruit.com/reef-pi-guide-5-dosing-controller.md)
- [Haunted Portrait](https://learn.adafruit.com/haunted-portrait.md)
- [PyPortal Trivia Time with the Open Trivia Database](https://learn.adafruit.com/pyportal-trivia-time-open-trivia-database.md)
- [Mini Pinball Table with Gemma M0](https://learn.adafruit.com/mini-pinball-table-with-gemma-m0.md)
- [All About Raspberry Pi HQ Camera Lenses](https://learn.adafruit.com/raspberry-pi-hq-camera-lenses.md)
- [Crickit Dancing Marionette Kit](https://learn.adafruit.com/universal-marionette-with-crickit.md)
