#include <controller.hpp>
Definition at line 14 of file controller.hpp.
◆ Controller()
◆ ~Controller()
| virtual okapi::Controller::~Controller |
( |
| ) |
|
|
virtual |
◆ clear()
| virtual std::int32_t okapi::Controller::clear |
( |
| ) |
|
|
virtual |
Clears all of the lines of the controller screen.
On vexOS version 1.0.0 this function will block for 110ms.
- Returns
- 1 if the operation was successful, PROS_ERR otherwise
◆ clearLine()
| virtual std::int32_t okapi::Controller::clearLine |
( |
std::uint8_t |
iline | ) |
|
|
virtual |
Clears an individual line of the controller screen.
- Parameters
-
| iline | the line number to clear in the range [0, 2]. |
- Returns
- 1 if the operation was successful, PROS_ERR otherwise
◆ getAnalog()
Returns the current analog reading for the channel in the range [-1, 1].
Returns 0 if the controller is not connected.
- Parameters
-
| ichannel | the channel to read |
- Returns
- the value of that channel in the range [-1, 1]
◆ getBatteryCapacity()
| virtual std::int32_t okapi::Controller::getBatteryCapacity |
( |
| ) |
|
|
virtual |
Gets the battery capacity of the given controller.
This function uses the following values of errno when an error state is reached: EACCES - Another resource is currently trying to access the controller port.
- Returns
- the controller's battery capacity
◆ getBatteryLevel()
| virtual std::int32_t okapi::Controller::getBatteryLevel |
( |
| ) |
|
|
virtual |
Gets the battery level of the given controller.
This function uses the following values of errno when an error state is reached: EACCES - Another resource is currently trying to access the controller port.
- Returns
- the controller's battery level
◆ getDigital()
Returns whether the digital button is currently pressed.
Returns false if the controller is not connected.
- Parameters
-
| ibutton | the button to check |
- Returns
- true if the button is pressed, false if the controller is not connected
◆ isConnected()
| virtual bool okapi::Controller::isConnected |
( |
| ) |
|
|
virtual |
Returns whether the controller is connected.
- Returns
- true if the controller is connected
◆ operator[]()
◆ rumble()
| virtual std::int32_t okapi::Controller::rumble |
( |
std::string |
irumblePattern | ) |
|
|
virtual |
Rumble the controller.
Controller rumble activation is currently in beta, so continuous, fast updates will not work well.
- Parameters
-
| irumblePattern | A string consisting of the characters '.', '-', and ' ', where dots are short rumbles, dashes are long rumbles, and spaces are pauses. Maximum supported length is 8 characters. |
- Returns
- 1 if the operation was successful or PROS_ERR if the operation failed, setting errno.
◆ setText()
| virtual std::int32_t okapi::Controller::setText |
( |
std::uint8_t |
iline, |
|
|
std::uint8_t |
icol, |
|
|
std::string |
itext |
|
) |
| |
|
virtual |
Sets text to the controller LCD screen.
- Parameters
-
| iline | the line number in the range [0-2] at which the text will be displayed |
| icol | the column number in the range [0-14] at which the text will be displayed |
| itext | the string to display |
- Returns
- 1 if the operation was successful, PROS_ERR otherwise
◆ buttonArray
◆ okapiId
◆ prosId
| pros::controller_id_e_t okapi::Controller::prosId |
|
protected |
The documentation for this class was generated from the following file: