2018 revision to classic DataBus AVC code.
Dependencies: LSM303DLM Servo SerialGraphicLCD L3G4200D IncrementalEncoder SimpleShell
Updater.h
- Committer:
- shimniok
- Date:
- 2018-12-12
- Revision:
- 14:1dd83e626153
- Parent:
- 13:5566df1250f1
- Child:
- 15:35c40765f7c3
File content as of revision 14:1dd83e626153:
#ifndef __UPDATER_H #define __UPDATER_H #include "mbed.h" #include "L3G4200D.h" class Updater: private mbed::NonCopyable<Updater> { public: /** Start the updater running - cannot be exited! * @param interval_ms is the interval in ms between calls to update() * @note Makes use of RTOS EventQueue and Event. */ void start(int interval_ms); /// Return singleton instance static Updater *instance(); /** Get gyro values * @return g array of x, y, and z gyro values * @return dt time since data last updated */ void gyro(int g[3], float& dt); /** Get encoder count * @return encoder count since last call */ int encoder(); private: /// Basic constructor (singleton) Updater() {} /// Update all sensors void update(); Timer *t; // timer used to measure dt int _gyro[3]; // gyro raw int _ecount; // encoder count float _dt; int thisTime; int lastTime; }; #endif