|
USB Host Shield 2.0
|
#include <PS3BT.h>


Public Attributes | |
| bool | PS3Connected |
| bool | PS3MoveConnected |
| bool | PS3NavigationConnected |
BluetoothService implementation | |
| void | disconnect () |
| void | ACLData (uint8_t *ACLData) |
| void | Run () |
| void | Reset () |
| void | onInit () |
Additional Inherited Members | |
Protected Member Functions inherited from BluetoothService | |
| bool | checkHciHandle (uint8_t *buf, uint16_t handle) |
Protected Attributes inherited from BluetoothService | |
| void(* | pFuncOnInit )(void) |
| BTD * | pBtd |
| uint16_t | hci_handle |
| uint32_t | l2cap_event_flag |
| uint8_t | identifier |
This BluetoothService class implements support for all the official PS3 Controllers: Dualshock 3, Navigation or a Motion controller via Bluetooth.
Information about the protocol can be found at the wiki: https://github.com/felis/USB_Host_Shield_2.0/wiki/PS3-Information.
| PS3BT::PS3BT | ( | BTD * | pBtd, |
| uint8_t | btadr5 = 0, |
||
| uint8_t | btadr4 = 0, |
||
| uint8_t | btadr3 = 0, |
||
| uint8_t | btadr2 = 0, |
||
| uint8_t | btadr1 = 0, |
||
| uint8_t | btadr0 = 0 |
||
| ) |
Constructor for the PS3BT class.
| pBtd | Pointer to BTD class instance. |
| btadr5,btadr4,btadr3,btadr2,btadr1,btadr0 | Pass your dongles Bluetooth address into the constructor, This will set BTD::my_bdaddr, so you don't have to plug in the dongle before pairing with your controller. |
|
virtual |
Used this to disconnect any of the controllers.
Implements BluetoothService.
| bool PS3BT::getButtonPress | ( | ButtonEnum | b | ) |
getButtonPress(ButtonEnum b) will return true as long as the button is held down.
While getButtonClick(ButtonEnum b) will only return it once.
So you instance if you need to increase a variable once you would use getButtonClick(ButtonEnum b), but if you need to drive a robot forward you would use getButtonPress(ButtonEnum b).
| b | ButtonEnum to read. |
| bool PS3BT::getButtonClick | ( | ButtonEnum | b | ) |
getButtonPress(ButtonEnum b) will return true as long as the button is held down.
While getButtonClick(ButtonEnum b) will only return it once.
So you instance if you need to increase a variable once you would use getButtonClick(ButtonEnum b), but if you need to drive a robot forward you would use getButtonPress(ButtonEnum b).
| b | ButtonEnum to read. |
| uint8_t PS3BT::getAnalogButton | ( | ButtonEnum | a | ) |
| uint8_t PS3BT::getAnalogHat | ( | AnalogHatEnum | a | ) |
| int16_t PS3BT::getSensor | ( | SensorEnum | a | ) |
Used to read the sensors inside the Dualshock 3 and Move controller.
| a | The Dualshock 3 has a 3-axis accelerometer and a 1-axis gyro inside. The Move controller has a 3-axis accelerometer, a 3-axis gyro, a 3-axis magnetometer and a temperature sensor inside. |
| float PS3BT::get9DOFValues | ( | SensorEnum | a | ) |
| bool PS3BT::getStatus | ( | StatusEnum | c | ) |
Get the status from the controller.
| c | The StatusEnum you want to read. |
| void PS3BT::printStatusString | ( | ) |
| String PS3BT::getTemperature | ( | ) |
| void PS3BT::setAllOff | ( | ) |
| void PS3BT::setRumbleOn | ( | RumbleEnum | mode | ) |
Turn on rumble.
| mode | Either RumbleHigh or RumbleLow. |
| void PS3BT::setRumbleOn | ( | uint8_t | rightDuration, |
| uint8_t | rightPower, | ||
| uint8_t | leftDuration, | ||
| uint8_t | leftPower | ||
| ) |
Turn on rumble using custom duration and power.
| rightDuration | The duration of the right/low rumble effect. |
| rightPower | The intensity of the right/low rumble effect. |
| leftDuration | The duration of the left/high rumble effect. |
| leftPower | The intensity of the left/high rumble effect. |
| void PS3BT::moveSetBulb | ( | ColorsEnum | color | ) |
Use this to set the color using the predefined colors in ColorsEnum.
| color | The desired color. |
|
inline |
Used to pass acldata to the services.
| ACLData | Incoming acldata. |
Implements BluetoothService.
|
protectedvirtual |
Used to run part of the state machine.
Implements BluetoothService.
|
protectedvirtual |
Use this to reset the service.
Implements BluetoothService.
|
protectedvirtual |
Called when the controller is successfully initialized. Use attachOnInit(void (*funcOnInit)(void)) to call your own function. This is useful for instance if you want to set the LEDs in a specific way.
Implements BluetoothService.
| bool PS3BT::PS3Connected |
| bool PS3BT::PS3MoveConnected |
| bool PS3BT::PS3NavigationConnected |