Energy harvesting mobile robot. Developed at Institute of Systems and Robotics — University of Coimbra.
Dependents: Mapping VirtualForces_debug OneFileToRuleThemAll VirtualForces_with_class ... more
Diff: Encoder.h
- Revision:
- 1:8569ac717e68
diff -r 15a30802e719 -r 8569ac717e68 Encoder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Encoder.h Tue Feb 20 13:37:47 2018 +0000 @@ -0,0 +1,26 @@ +#ifndef ENCODER_H +#define ENCODER_H + +#include "mbed.h" + +/** Encoder class. + * Manages one magnetic encoder AS5600. Reads its absolute value and performs + * the conversion of the value to incremental valeu. + */ +class Encoder +{ +public: + Encoder(I2C* i2c_in, Mutex* mutex_in, char invert_in); + long int readAbsolute(); + long int incremental(); + long int readIncrementalValue(); + +private: + I2C* _i2c; + Mutex* _mutex; + short int prev_L; + long int total_L; + char _invert; +}; + +#endif \ No newline at end of file