LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
okapi::IntegratedEncoder Class Reference

#include <integratedEncoder.hpp>

Inheritance diagram for okapi::IntegratedEncoder:
okapi::ContinuousRotarySensor okapi::RotarySensor okapi::ControllerInput< double >

Public Member Functions

 IntegratedEncoder (const okapi::Motor &imotor)
 Integrated motor encoder.
 
 IntegratedEncoder (std::int8_t iport, bool ireversed=false)
 Integrated motor encoder.
 
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.
 
- Public Member Functions inherited from okapi::RotarySensor
virtual ~RotarySensor ()
 

Protected Attributes

std::uint8_t port
 
std::int8_t reversed {1}
 

Detailed Description

Definition at line 13 of file integratedEncoder.hpp.

Constructor & Destructor Documentation

◆ IntegratedEncoder() [1/2]

okapi::IntegratedEncoder::IntegratedEncoder ( const okapi::Motor imotor)

Integrated motor encoder.

Uses the encoder inside the V5 motor.

Parameters
imotorThe motor to use the encoder from.

◆ IntegratedEncoder() [2/2]

okapi::IntegratedEncoder::IntegratedEncoder ( std::int8_t  iport,
bool  ireversed = false 
)

Integrated motor encoder.

Uses the encoder inside the V5 motor.

Parameters
iportThe motor's port number in the range [1, 21].
ireversedWhether the encoder is reversed.

Member Function Documentation

◆ controllerGet()

virtual double okapi::IntegratedEncoder::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::IntegratedEncoder::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::IntegratedEncoder::reset ( )
overridevirtual

Reset the sensor to zero.

Returns
1 on success, PROS_ERR on fail

Implements okapi::ContinuousRotarySensor.

Member Data Documentation

◆ port

std::uint8_t okapi::IntegratedEncoder::port
protected

Definition at line 53 of file integratedEncoder.hpp.

◆ reversed

std::int8_t okapi::IntegratedEncoder::reversed {1}
protected

Definition at line 54 of file integratedEncoder.hpp.


The documentation for this class was generated from the following file: