Code for the car to drive in a figure eight motion
Dependencies: mbed-rtos mbed MODSERIAL mbed-dsp telemetry
Diff: encoder.h
- Revision:
- 13:97708869a4ba
- Parent:
- 11:f8aa39c19477
--- a/encoder.h Fri Mar 20 03:34:38 2015 +0000 +++ b/encoder.h Fri Mar 20 04:04:04 2015 +0000 @@ -1,7 +1,12 @@ #ifndef ENCODER_H #define ENCODER_H +#include "mbed.h" + + class Encoder{ + Timer t; + //Intervals used during encoder data collection to measure velocity int interval1; int interval2; @@ -31,8 +36,8 @@ float large_avg_speed_list [100]; float small_avg_speed_list [10]; public: - Encoder(); - void velocity_control(float duty_cyc, float tuning_const); + Encoder(Timer t); + float velocity_control(float duty_cyc, float tuning_const); void fallInterrupt(); void riseInterrupt(); private: