|
| PSBuzz (USB *p) |
|
bool | connected () |
|
void | attachOnInit (void(*funcOnInit)(void)) |
|
|
bool | getButtonPress (ButtonEnum b, uint8_t controller=0) |
|
bool | getButtonClick (ButtonEnum b, uint8_t controller=0) |
|
void | setLedRaw (bool value, uint8_t controller=0) |
|
void | setLedOffAll () |
|
void | setLedOff (uint8_t controller=0) |
|
void | setLedOnAll () |
|
void | setLedOn (uint8_t controller=0) |
|
void | setLedToggle (uint8_t controller=0) |
|
| HIDUniversal (USB *p) |
|
virtual bool | SetReportParser (uint8_t id, HIDReportParser *prs) |
|
virtual uint8_t | Init (uint8_t parent, uint8_t port, bool lowspeed) |
|
virtual uint8_t | Release () |
|
virtual uint8_t | Poll () |
|
virtual uint8_t | GetAddress () |
|
virtual bool | isReady () |
|
virtual void | EndpointXtract (uint8_t conf, uint8_t iface, uint8_t alt, uint8_t proto, const USB_ENDPOINT_DESCRIPTOR *ep) |
|
| HID (USB *pusb) |
|
const USB * | GetUsb () |
|
uint8_t | SetProtocol (uint8_t iface, uint8_t protocol) |
|
uint8_t | GetProtocol (uint8_t iface, uint8_t *dataptr) |
|
uint8_t | GetIdle (uint8_t iface, uint8_t reportID, uint8_t *dataptr) |
|
uint8_t | SetIdle (uint8_t iface, uint8_t reportID, uint8_t duration) |
|
uint8_t | GetReportDescr (uint16_t wIndex, USBReadParser *parser=NULL) |
|
uint8_t | GetHidDescr (uint8_t ep, uint16_t nbytes, uint8_t *dataptr) |
|
uint8_t | GetReport (uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr) |
|
uint8_t | SetReport (uint8_t ep, uint8_t iface, uint8_t report_type, uint8_t report_id, uint16_t nbytes, uint8_t *dataptr) |
|
virtual uint8_t | ConfigureDevice (uint8_t parent, uint8_t port, bool lowspeed) |
|
virtual void | ResetHubPort (uint8_t port) |
|
virtual boolean | DEVCLASSOK (uint8_t klass) |
|
This class implements support for the PS Buzz controllers via USB. It uses the HIDUniversal class for all the USB communication.
Definition at line 43 of file PSBuzz.h.
bool PSBuzz::getButtonPress |
( |
ButtonEnum |
b, |
|
|
uint8_t |
controller = 0 |
|
) |
| |
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).
- Parameters
-
b | ButtonEnum to read. |
controller | The controller to read from. Default to 0. |
- Returns
- getButtonPress(ButtonEnum b) will return a true as long as a button is held down, while getButtonClick(ButtonEnum b) will return true once for each button press.
Definition at line 52 of file PSBuzz.cpp.
bool PSBuzz::getButtonClick |
( |
ButtonEnum |
b, |
|
|
uint8_t |
controller = 0 |
|
) |
| |
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).
- Parameters
-
b | ButtonEnum to read. |
controller | The controller to read from. Default to 0. |
- Returns
- getButtonPress(ButtonEnum b) will return a true as long as a button is held down, while getButtonClick(ButtonEnum b) will return true once for each button press.
Definition at line 56 of file PSBuzz.cpp.