Same as mallet... but distance

Dependencies:   EthernetInterface NetworkAPI mbed-rtos mbed

Fork of MalletFirmware by Impact-Echo

Committer:
willange
Date:
Tue Dec 09 17:37:12 2014 +0000
Revision:
30:1da0bb9c31a6
Parent:
22:523e316cbe70
a basic timer

Who changed what in which revision?

UserRevisionLine numberNew contents of line
timmey9 22:523e316cbe70 1 #ifndef ANGLE_ENCODER_H
timmey9 22:523e316cbe70 2 #define ANGLE_ENCODER_H
timmey9 22:523e316cbe70 3
timmey9 22:523e316cbe70 4 #include "mbed.h"
timmey9 22:523e316cbe70 5
timmey9 22:523e316cbe70 6 #define SPI_DELAY 4 // must be 4 or greater, otherwise the angle encoder can't keep up with the communication
timmey9 22:523e316cbe70 7
timmey9 22:523e316cbe70 8 class AngleEncoder {
timmey9 22:523e316cbe70 9 public:
timmey9 22:523e316cbe70 10 AngleEncoder(PinName mosi, PinName miso, PinName sclk, PinName cs, int bits, int mode, int hz);
timmey9 22:523e316cbe70 11 int nop();
timmey9 22:523e316cbe70 12 int absolute_angle();
timmey9 22:523e316cbe70 13 bool set_zero();
timmey9 22:523e316cbe70 14 bool set_zero(int*);
timmey9 22:523e316cbe70 15
timmey9 22:523e316cbe70 16 private:
timmey9 22:523e316cbe70 17 SPI _spi;
timmey9 22:523e316cbe70 18 DigitalOut _cs;
timmey9 22:523e316cbe70 19 };
timmey9 22:523e316cbe70 20
timmey9 22:523e316cbe70 21 #endif