USB Host Shield 2.0
|
#include <XBOXONESParser.h>
Public Member Functions | |
XBOXONESParser () | |
int16_t | getAnalogHat (AnalogHatEnum a) |
void | setRumbleOff () |
void | setRumbleOn (uint8_t leftTrigger, uint8_t rightTrigger, uint8_t leftMotor, uint8_t rightMotor) |
Xbox One S Controller functions | |
uint16_t | getButtonPress (ButtonEnum b) |
bool | getButtonClick (ButtonEnum b) |
Protected Member Functions | |
void | Parse (uint8_t len, uint8_t *buf) |
void | Reset () |
virtual void | sendOutputReport (uint8_t *data, uint8_t nbytes)=0 |
This class parses all the data sent by the Xbox One S controller
Definition at line 54 of file XBOXONESParser.h.
|
inline |
Constructor for the XBOXONESParser class.
Definition at line 57 of file XBOXONESParser.h.
uint16_t XBOXONESParser::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. |
Definition at line 72 of file XBOXONESParser.cpp.
bool XBOXONESParser::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. |
Definition at line 84 of file XBOXONESParser.cpp.
int16_t XBOXONESParser::getAnalogHat | ( | AnalogHatEnum | a | ) |
void XBOXONESParser::setRumbleOff | ( | ) |
Used to set the rumble off.
Definition at line 186 of file XBOXONESParser.cpp.
void XBOXONESParser::setRumbleOn | ( | uint8_t | leftTrigger, |
uint8_t | rightTrigger, | ||
uint8_t | leftMotor, | ||
uint8_t | rightMotor | ||
) |
Used to turn on rumble continuously.
leftTrigger | Left trigger force. |
rightTrigger | Right trigger force. |
leftMotor | Left motor force. |
rightMotor | Right motor force. |
Definition at line 200 of file XBOXONESParser.cpp.
|
protected |
Used to parse data sent from the Xbox One S controller.
len | Length of the data. |
buf | Pointer to the data buffer. |
Definition at line 112 of file XBOXONESParser.cpp.
|
protected |
Used to reset the different buffers to their default values
Definition at line 171 of file XBOXONESParser.cpp.
|
protectedpure virtual |
Send the output to the Xbox One S controller. This is implemented in XBOXONESBT.h.
output | Pointer to data buffer. |
nbytes | Bytes to send. |
Implemented in XBOXONESBT.