Build a Wireless Game Controller using a BBC micro:bit
Build a Wireless Game Controller using a BBC micro:bit

Build a Wireless Game Controller using a BBC micro:bit

Tags
micro:bitelectronicsmakecode
Date
March 21, 2024
Class
Explore: Coding & Computer Science
Author
Z
Zach
Class Section
Documentation Type
tutorial

Introduction

Video games are fun! And they get better with arcade buttons! You may be surprised how easy it is to build a simple but functional wireless game controller; if you have a BBC micro:bit and a few buttons lying around, give it a try!

The controller pretends to be a keyboard and connects to a device via Bluetooth; on the computer/tablet/phone side, you can simply map the appropriate characters to game functions as you would with any other keyboard. The program is a few blocks of MakeCode, plus a handy micro:bit Bluetooth keyboard library.

Prerequisites

This tutorial assumes a basic working knowledge of the BBC micro:bit and MakeCode. Nothing fancy! You just need to be comfortable assembling basic block-based programs and uploading them to the board. If you are new to the micro:bit and/or MakeCode, run through our micro:bit Basics tutorial, or head to the micro:bit MakeCode Tutorials and complete the first one (helpfully labeled “New? Start Here!”).

Build It!

Things You Will Need

Construction

Programming

Install the Bluetooth Keyboard Library

Hello World!

Bluetooth Pairing

A Basic Controller Program

Testing

work-in-progress