USB Host Shield 2.0
|
#include <XBOXONESParser.h>
Public Member Functions | |
XBOXONESParser () | |
int16_t | getAnalogHat (AnalogHatEnum a) |
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 () |
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 | ) |
|
protected |
Used to set the rumble off. Used to turn on rumble continuously.
leftTrigger | Left trigger force. |
rightTrigger | Right trigger force. |
leftMotor | Left motor force. |
rightMotor | Right motor force. 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.