Bluetooth is a standardized communication protocol that operates in the ISM Band from 2.4 to 2.485 GHz. Bluetooth is optimal for short range (under 100m) transfers of small packets of data. This protocol consists of a collection of profiles including Serial Port Profile (SPP), Human Interface Device (HID), Hands-Free Profile (HPF), Advanced Audio Distribution Profile (A2DP), or A/V Remote Control Profile (AVRCP).
Sparkfun provides a comprehensive introduction to bluetooth technology, which can be read here.
Perhaps more commonly known is Broadcom's BCM2042 SoC (System on a Chip). Nintendo utilized Broadcom's technology to create the wireless functionality in a Wii remote. The Wii remote follows the HID (Human Interface Device) protocol.
Communicating with the Wii Remote
All bluetooth devices have a unique 48-bit address (BD_ADDR) represented as a 12 digit hexadecimal value. Given that the 24 most significant bits idintify the manufacturer, we are left with the 24 least significant bits to distinguish between devices.
After installing the CWiiD python package, the Raspberry Pi will be capable of regonizing a the Wii remote when performing a scan. Simultaneously holding down the 1 and 2 buttons allows the remote to enter its Discoverable State, thanks to the BCM2042.
Given that we are able to identify which button was pressed based on the value returned by wm.state['buttons'], it is possible to repurpose the controller for other tasks. To the right is a portion of the code where we call upon the previously made function to actuate the servo.>
We additionally set the remote's on board LEDs to light as specific buttons were pressed in order to test whether the unit was able to also receive data. Pressing left or right on the directional pad flashes the LED. Pressing 1 or 2 puts the servo in its left most or right most state respectively, and the remote is programmed to rumble.
The game controller was successfully repurposed to actuate a servo. Any output device can be placed on the receiving end.
© Team459 2018