Posts

Sony PS3 Controller support added to USB Host library

A fragment of PS3 Bluetooth code

A fragment of PS3 Bluetooth code


I’m quite pleased to announce that ever-popular Sony PS3 game controllers are now supported by current (rev.2.0) USB Host Library. Kristian Lauszus from TKJ Electronics developed a library to interface with Dualshock 3, as well as Move Navigation and Motion controllers via a Bluetooth dongle (only CSR-based ones are supported at the moment). This library has been merged into the main code and I will start maintaining it as soon as my Dualshock 3 arrives.

Sony PS3 controllers are advanced versions of ordinary HID joysticks. They can be interfaced via USB or Bluetooth, the buttons can be read as analog or digital and controller contains rumble motor which can be activated remotely to indicate a hit, for example. The controller also contains a gyroscope and accelerometers so it is possible to control a robot by simply waving and/or rotating the controller.

Kristian got his inspiration from Richard Ibbotson’s articles, as well as works by Tomoyuki Tanaka and others (full list can be found in PS3README file). His Wiki page gives implementation details, communication protocol, differences between controllers, as well as plenty of links to other sources of PS3 controller interfacing knowledge.

Kristian developed this library as a part of his Balancing robot project. The project is very well documented – if you are interested in robots, PID or remote control, please take a look. I also enjoyed watching this video presentation, give it a shot to see balancing robot in action.

Oleg.

PS3 and Wiimote Game Controllers on the Arduino Host Shield: Part 3

Wiimote controller wit USB Host Shield

Wiimote controller wit USB Host Shield

This is the third part of a series of articles written to describe development of interface between Arduino and popular game controllers using USB Host Shield. Previous parts:

Revision 0.4 – 13th January 2010

Part 3. Develop the Bluetooth USB and HCI interface used in the support of the Wiimote and PS3 game controller, and also some utilities needed to analyse and configure these devices.

1. USB Interface
As before, we first look at the descriptors for the USB dongle using the USB_Desc sketch. The result is:


Continue reading PS3 and Wiimote Game Controllers on the Arduino Host Shield: Part 3

PS3 and Wiimote Game Controllers on the Arduino Host Shield: Part 2

Sony PS3 controller

Sony PS3 controller

This is the second part of a series of articles written to describe development of interface between Arduino and popular game controllers using USB Host Shield. Previous parts:

Revision 0.6 – 13th January 2010

Part 2: Develop the USB interface to the PS3 controller

1.       USB Reduced Hosts

Full USB hosts such as Windows and Linux based computers can manage a large variety of different USB devices and load appropriate USB drivers for each device. There is an enumeration or discovery phase where the host gathers information on the attached USB device and uses this information for the driver selection and configuration. In small embedded applications this is not possible or required to support this variety, so the application usually only supports a few devices, often only one. This means the discovery process can be much reduced since the results are already known. This will reduce the memory required for the application by hard coding the device configuration into the application.

Though the configuration will be hard coded, we still need to initially gather the information from the device itself and other sources.

The existing device drivers mentioned above for Windows and Linux are important in our development process. The Windows drivers are usually complete, but not available in source form. Linux drivers are available in source form, though not always as complete. Device manufacturers are usually very reluctant to provide information required to build a driver or embedded application. So we rely on copying Linux code or “sniffing” Windows code to give us guidance.


Continue reading PS3 and Wiimote Game Controllers on the Arduino Host Shield: Part 2

PS3 and Wiimote Game Controllers on the Arduino Host Shield: Part 1

Bluetooth

Bluetooth


Revision 0.9 – 13th January 2010

Part 1: Introduction

1.       Background
These articles describe how to interface PS3 and Wiimote game controllers directly onto the Arduino using the USB Host Shield. These controllers have not previously been directly connected to an Arduino due to the USB and Bluetooth interfaces and protocols used, and their relative complexity. The game controllers are a good match to the capabilities of the Arduino, and to the imagination of Arduino users, they have not only buttons and joysticks, but also motion sensing, and other goodies which deserve to be in the hands and ideas of Arduino users. Also I hope these articles provide some guidance for people to develop other USB host and Bluetooth applications for small embedded processors.
Arduino already comes in versions which have USB and Bluetooth interfaces, but these are not suitable for our chosen game controllers. When used in USB mode, the PS3 controller is a USB device and needs to talk to a USB host. The normal Arduino USB interface is also a device, so not compatible. When in Bluetooth mode, both of these game controllers use the Bluetooth HID protocol and this is not compatible with the commonly used Bluetooth modules which support only the RFCOMM Serial Port Protocol. Arduino users have successfully used a PC as an intermediary between the game controllers and the Arduino, so the PC is host to both devices.

These articles were written by Richard who is new to the Arduino, blogs, github, libraries, etc, so please give me any help and feedback on how I might improve or correct these articles and software.


Continue reading PS3 and Wiimote Game Controllers on the Arduino Host Shield: Part 1