NXPCUP-libary
Library for car's control board on NXPCUP competition based on the Mbed framework.
Classes | List of all members
nxpcup::Encoder Class Reference

#include <Encoder.h>

Classes

struct  Config
 
 Encoder (Config config)
 
float update (uint16_t timeSinceLastCallUs)
 
float speed () const
 
float distance () const
 
void resetDistance ()
 

Constructor & Destructor Documentation

nxpcup::Encoder::Encoder ( Config  config)
inline

Constructor of class Encoder.

Parameters
configstructConfig}

Member Function Documentation

float nxpcup::Encoder::distance ( ) const
inline

Get the distance from start of the program or last resetresetDistance}

Returns
distance in meters
void nxpcup::Encoder::resetDistance ( )
inline

Reset the internal counter for distance measurement.

float nxpcup::Encoder::speed ( ) const
inline

Get the actual speed.

Returns
speed in [m/s]
float nxpcup::Encoder::update ( uint16_t  timeSinceLastCallUs)
inline

Update speed and distance.

Parameters
timeSinceLastCallUstime in microseconds from last call this function (NOT USED)
Returns
velocity in [m/s]

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