2018 revision to classic DataBus AVC code.
Dependencies: LSM303DLM Servo SerialGraphicLCD L3G4200D IncrementalEncoder SimpleShell
Diff: Updater.h
- Revision:
- 11:8ec858b7c6d1
- Child:
- 12:3cd91e150d9c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Updater.h Wed Dec 12 17:20:16 2018 +0000 @@ -0,0 +1,29 @@ +#ifndef __UPDATER_H +#define __UPDATER_H + +#include "mbed.h" +#include "L3G4200D.h" + +class Updater { +public: + void start(int interval_ms); + + static Updater *instance(); + + int get_gyro() { return g; } + +private: + typedef struct { + int g[3]; // gyro + float dt; // delta time + } sensor_data_t; + + Updater() {} // parameterize + Timer *t; + void update(); + int g; + int thisTime; + int lastTime; +}; + +#endif \ No newline at end of file