Energy harvesting mobile robot. Developed at Institute of Systems and Robotics — University of Coimbra.

Dependencies:   RF24

Dependents:   Mapping VirtualForces_debug OneFileToRuleThemAll VirtualForces_with_class ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Encoder.h Source File

Encoder.h

00001 #ifndef ENCODER_H
00002 #define ENCODER_H
00003 
00004 #include "mbed.h"
00005 
00006 /** Encoder class.
00007  * Manages one magnetic encoder AS5600. Reads its absolute value and performs
00008  * the conversion of the value to incremental valeu.
00009  */
00010 class Encoder
00011 {
00012 public:
00013     Encoder(I2C* i2c_in, Mutex* mutex_in, char invert_in);
00014     long int readAbsolute();
00015     long int incremental();
00016     long int readIncrementalValue();
00017 
00018 private:
00019     I2C* _i2c;
00020     Mutex* _mutex;
00021     short int prev_L;
00022     long int total_L;
00023     char _invert;
00024 };
00025 
00026 #endif