37 lines
619 B
C++
37 lines
619 B
C++
#ifndef __ENCODER_H
|
|
#define __ENCODER_H
|
|
|
|
#include <cstdio>
|
|
#include "ti_msp_dl_config.h"
|
|
|
|
class Encoder {
|
|
public:
|
|
struct Speed {
|
|
int left;
|
|
int right;
|
|
};
|
|
|
|
static void init();
|
|
static void inject();
|
|
|
|
static Speed getSpeeds();
|
|
static Speed getRealSpeeds();
|
|
|
|
static int getLeftSpeed();
|
|
static int getRealLeftSpeed();
|
|
|
|
static int getRightSpeed();
|
|
static int getRealRightSpeed();
|
|
|
|
static int getLeftDirection();
|
|
static int getRightDirection();
|
|
|
|
static Speed ticks;
|
|
static Speed direction;
|
|
static Speed speed;
|
|
static Speed real_speed;
|
|
};
|
|
|
|
|
|
#endif
|