#include <adiEncoder.hpp>
|
| | ADIEncoder (std::uint8_t iportTop, std::uint8_t iportBottom, bool ireversed=false) |
| | An encoder in an ADI port.
|
| |
| | ADIEncoder (std::tuple< std::uint8_t, std::uint8_t, std::uint8_t > iports, bool ireversed=false) |
| | An encoder in an ADI port.
|
| |
| virtual double | get () const override |
| | Get the current sensor value.
|
| |
| virtual std::int32_t | reset () override |
| | Reset the sensor to zero.
|
| |
| virtual double | controllerGet () override |
| | Get the sensor value for use in a control loop.
|
| |
| virtual | ~RotarySensor () |
| |
|
| pros::c::ext_adi_encoder_t | enc |
| |
Definition at line 12 of file adiEncoder.hpp.
◆ ADIEncoder() [1/2]
| okapi::ADIEncoder::ADIEncoder |
( |
std::uint8_t |
iportTop, |
|
|
std::uint8_t |
iportBottom, |
|
|
bool |
ireversed = false |
|
) |
| |
An encoder in an ADI port.
pros::c::ext_adi_encoder_t enc
- Parameters
-
| iportTop | The "top" wire from the encoder with the removable cover side up. This must be in port 1, 3, 5, or 7 (A, C, E, or G). |
| iportBottom | The "bottom" wire from the encoder. This must be in port 2, 4, 6, or 8 (B, D, F, or H). |
| ireversed | Whether the encoder is reversed. |
◆ ADIEncoder() [2/2]
| okapi::ADIEncoder::ADIEncoder |
( |
std::tuple< std::uint8_t, std::uint8_t, std::uint8_t > |
iports, |
|
|
bool |
ireversed = false |
|
) |
| |
An encoder in an ADI port.
auto reversedEnc =
ADIEncoder({1,
'A',
'B'},
true);
- Parameters
-
| iports | The ports the encoder is plugged in to in the order {smart port, top port, bottom port}. The smart port is the smart port number ([1, 21]). The top port is the "top" wire from the encoder with the removable cover side up. This must be in port 1, 3, 5, or 7 (A, C, E, or G). The bottom port is the "bottom" wire from the encoder. This must be in port 2, 4, 6, or 8 (B, D, F, or H). |
| ireversed | Whether the encoder is reversed. |
◆ controllerGet()
| virtual double okapi::ADIEncoder::controllerGet |
( |
| ) |
|
|
overridevirtual |
Get the sensor value for use in a control loop.
This method might be automatically called in another thread by the controller.
- Returns
- the current sensor value, or
PROS_ERR on a failure.
Implements okapi::ControllerInput< double >.
◆ get()
| virtual double okapi::ADIEncoder::get |
( |
| ) |
const |
|
overridevirtual |
Get the current sensor value.
- Returns
- the current sensor value, or
PROS_ERR on a failure.
Implements okapi::RotarySensor.
◆ reset()
| virtual std::int32_t okapi::ADIEncoder::reset |
( |
| ) |
|
|
overridevirtual |
◆ enc
| pros::c::ext_adi_encoder_t okapi::ADIEncoder::enc |
|
protected |
The documentation for this class was generated from the following file: