PS3 Dualshock Controller (Bluetooth) - USB Host

HobbyTronics PS3 Dualshock Controller (Bluetooth) - USB Host
Cliquer pour agrandir
Modèle : PS3_BT
Fabricant : HobbyTronics
Évaluation : Aucune évaluation

HobbyTronics

PS3 Dualshock Controller (Bluetooth) - USB Host

This USB PS3 Dualshock Controller Software allows you to connect a PS3 Dualshock Controller to one of our USB Host Boards and read the analog stick inputs, button presses, accelerometer and button pressure using I2C or serial TTL.

This is the Bluetooth version of our PS3 software. With the use of a compatable Bluetooth Dongle you can now connect to your PS3 Controller wirelessly using the built-in Bluetooth.
This makes using a PS3 controller as the basis for your robotics project very easy to implement.

This is a free software download for our USB Host Board and USB Host IC's (SOIC, DIP, SSOP).
To buy - See the USB Host Board and IC product pages (links on the pictures below) for details on pricing and installing this software.

Download Software
Click Here to Download (Version 1.01)
USB Host BoardUSB Host Mini
USB Host Boards
USB Host IC SOIC  USB Host IC DIP  USB Host IC SSOP
USB Host IC's

The USB PS3 Dualshock Controller software for our USB Host board allows you to easily read the analog joysticks, accelerometer, button pressure values and all the buttons from a PS3 Controller. Output from the host board is via serial (mainly for testing) and also via I2C. Now you can easily interface this versatile PS3 Game Controller into virtually any Microcontroller project.

Features

  • Bluetooth Connection to PS3 controller
  • Easily Sync PS3 and Bluetooth Dongle
  • Serial communication at baud rates 2400, 4800, 9600, 14400, 19200, 38400, 57600, 115200
  • I2C communication

Use it to control

  • A Robotic Arm and grabber (robot claw)
  • Wheeled or tracked vehicles
  • Your own Arcade game on a Raspberry Pi

Configuration Settings

Configuration can be done by sending commands via the serial port. Either by microcontroller or via a terminal program and a suitable serial TTL connection. Commands take effect immediately and are stored in Eeprom on the board.

The following Commands are available.

SERIAL <value> Set Serial Output ON/OFF
[ON|OFF]
HEX <value> Set Serial Hex Output ON/OFF
[ON|OFF]
PS4OUTPUT <value> Use PS4 Output format (see below) ON/OFF
[ON|OFF]
BAUD <value> Set Serial Port Baud Rate
[2400|4800|9600|14400|19200|38400|57600|115200]
I2C <value> Set I2C Address
[1-127]


BAUD Rate

The USB Host board will communicate over serial TTL at the following baud rates

  • 2400
  • 4800
  • 9600 (default)
  • 14400
  • 19200
  • 38400
  • 57600
  • 115200

The default baud rate is 9600

SERIAL

SERIAL turns on or off the output of serial data when the PS3 controller is plugged in. Data is output in ASCII text format.
Turn it on for testing the PS3 controller or if your want the serial data. Turn it off when using I2C communication to save on processing.

NOTE: The default baud rate setting of 9600 should be increased to 115200. At 9600 baud there is too much data to transmit and you will see delays in the joysticks and buttons.

HEX

The HEX option converts the SERIAL output into single Hexadecimal bytes and adds a CRC checkdigit. It reduces the amount of data transmitted and makes it easier to process at the receiving device.It is very useful for transmission of the data via XBee to a remote device.

PS4OUTPUT

The newer PS4 controller has a slightly different output format than the data from the PS3 controller. If you turn this option on then the output data format will be in a form compatible with the PS4 controller.

Why is this useful? It makes it easier to code the robotics side of your project as the data format is consistant whether you want to use a PS3 or PS4 controller.

If you are using the PS4OUTPUT then you should refer to the PS4 BT USB Host page for details

I2C Address

The I2C default address is 41. This can be changed to any value between 1 and 127 using the I2C command

Help

Help can be displayed at any time by typing ? or HELP

The current settings for SERIAL and I2C address are displayed.

?

USB Host PS3 (Bluetooth) Dual Shock Controller v1.01

  Bluetooth Address       - Address of Attached Bluetooth Device
    00 00 00 00 00 00
  SERIAL <value>          - Set Serial Data Output On/Off
   (ON)                   - [ON|OFF]
  HEX <value>             - Set Serial Data Output Hexadecimal On/Off
   (OFF)                  - [ON|OFF]
  PS4OUTPUT <value>       - Set Serial Data Output to PS4 Style On/Off
   (ON)                   - [ON|OFF]
  BAUD <value>            - Set Serial Port Baud Rate
                            [2400|4800|9600|14400|19200|38400|57600|115200]
  I2C <value>             - Set I2C Address
   (41 )                    [1 - 127]
  HELP or ?               - display help

Synching the PS3 controller with the bluetooth dongle only needs doing once
1. Plug in Bluetooth dongle and power up. The Bluetooth Address will be read
2. Unplug the dongle and plug in your PS3 controller using a USB cable.
   The bluetooth address will now be sent and stored in the PS3 controller.
3. Unplug the PS3 controller and plug the Bluetooth dongle back in.
   Press the power button on the PS3 controller.
4. The LED's on the PS3 controller will flash for a few seconds
   LED1 will go solid red and the motors will rumble - you are connected.

 

Synching with your PS3 Controller

Just as with any bluetooth connection, the Bluetooth Dongle and your PS3 Controller have to be synched in order to communicate. With the PS3 controller, this is not done using the usual 4-digit passkey method. Instead, it is done by storing the Bluetooth Address of the dongle into the PS3 controller.

Synching the PS3 controller with the bluetooth dongle only needs to be done once.

Our code makes synching very straightforward; just follow these steps.

  1. Power up the USB Host board
  2. Plug the Bluetooth dongle into the USB Host board. The Bluetooth Address will be read and stored on the USB Host board
  3. Unplug the dongle and plug in your PS3 controller using a USB cable. The bluetooth address will now be sent and stored in the PS3 controller.
  4. Unplug the PS3 controller and plug the Bluetooth dongle back in. Press the power button on the PS3 controller.
  5. The LED's on the PS3 controller will flash for a few seconds, then LED1 will go solid red and the motors will rumble briefly - you are connected.

Reading the Data

As mentioned, there are two ways to obtain the PS3 data from the USB Host board. Either by simple serial output or by using I2C communication. Although the serial output is meant primarily for testing the controller, the HEX output has a useful purpose if you want to transmit the data wirelessly (e.g. to control a UAV or robot) as it can be fed directly into an XBee radio (or similar) for easy transmission.

Serial Data Output

Serial data output looks like the following

PS3,129,128,128,128,90,94,0,0,0,0,0,0,0,0,0,0,0,0,00000000000000000

It conforms to the same format as the I2C data table shown below. Joystick and pressure outputs are comma delimited, whilst the button presses are not. each line is terminated with a CRLF.

As mentioned above you should set the baud rate to 115200.

HEX Serial Data Output

This is similar to the Serial data output, but each value is output as a single hexadecimal value and there are no comma delimiters. Additionally there is an extra CRC8 checkdigit added to the data to enable the data to be checked for errors. The HEX output is useful for transmission via XBee radio to remote devices.

The data is in the same format as the I2C data table shown below and transmitted as single bytes. Each transmission is prefixed by characters "PS3" and ended with CRLF.
A total of 41 characters is transmitted ( 3 for PS3, 35 data, 1 CRC, 2 for CRLF)

There is a link to an example Arduino program for reading the HEX data at the bottom of the page.

I2C Data Output

I2C data can be read in the normal I2C manner using the following register values for obtaining data. Data can be read on one complete go or read individually. There is a link to an example Arduino program for reading the data at the bottom of the page.

When using I2C, you should disable the Serial Output to avoid delays in the data. Use the command SERIAL OFF

Register Description
0 Left Joystick X
1 Left Joystick Y
2 Right Joystick X
3 Right Joystick Y
4 Accelerometer X (0-255) 128 center
5 Accelerometer Y (0-255) 128 center
6 Pressure UP
7 Pressure RIGHT
8 Pressure DOWN
9 Pressure LEFT
10 Pressure LB
11 Pressure RB
12 Pressure LT
13 Pressure RT
14 Pressure Triangle
15 Pressure Circle
16 Pressure X
17 Pressure Square
18 Button LEFT
19 Button DOWN
20 Button RIGHT
21 Button UP
22 Button START
23 Button Right Joystick
24 Button Left Joystick
25 Button SELECT
26 Button SQUARE
27 Button X
28 Button CIRCLE
29 Button TRIANGLE
30 Button RT
31 Button LT
32 Button RB
33 Button LB
34 Button PS3

Compatable Bluetooth Dongles

To connect with the PS3 controller you need a Bluetooth dongle that supports high speed data and EDR.

We have a suitable dongle available here

Documents and Links

Arduino Example program for Reading data via I2C
Arduino Example program for Reading HEX serial data

 

Écrire un avis
Votre nom :


Votre avis : N.B. : Le HTML n'est pas pris en charge !

Évaluation : Mauvais            Bon

Saisir le code ci-dessous :

Il n'y a aucune image supplémentaire pour ce produit.
PS3 Dualshock Controller (Bluetooth) - USB Host
$ 00€ New In Stock
Panier
Aucun article
 
Frais de Livraison

France & EU - poste aerienne de 3.40€ +VAT
Plus d'informations...

 
Marques
 
 Check out our videos