Files

README.md

View this project on CADLAB.io.

WirelessController

WirelessController is an ATmega328p based video game controller that controls a <![CDATA[]]>PixelShirtV2<![CDATA[]]>, which is Arduino based collection of games, using an nRF24L01+ wireless radio.

The Firmware

The firmware is relatively simple. The main function initializes the hardware and calibrates the joystick. An infinite loop polls the digital buttons and analog X & Y values of the joystick. If any of the values change, a bitpacked message containing the controller's state is sent to the PixelShirtV2.

A timer interrupt is called once a second to toggle a heartbeat LED.

Each controller's ID must be hardcoded differently when compiling and flashing the firmware. The PixelShirtV2 can support up to four controllers simultaneously.

This project uses the <![CDATA[]]>nrf24L01+ radio library<![CDATA[]]>.

The Hardware

The controller is powered by two AA batteries, which make nice grips on the bottom. The ATmega328p is populated underneath the PCB. The 3x2 header is an ISP header, and the 6x1 header is for serial debug over an FTDI cable.

I populated one of the controllers with red LEDs, and the other with blue LEDs. These are conveniently the two player colors used in all games, which made identifying player one and player two very easy.

Screenshots of the PCB layout. The top view is first, then the bottom view.

This is what it looks like all soldered together.

Thanks

3D models and print courtesy of <![CDATA[]]>gbsoares<![CDATA[]]>. <![CDATA[]]>jgordo32<![CDATA[]]> assisted with hardware design.

Report a bug