Saltware / Mbed 2 deprecated Water Play

Dependencies:   mbed DRV88255 TextLCD Ping mbed-rtos

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MockSensorController.h Source File

MockSensorController.h

00001 #ifndef __MOCKSENSORCONTROLLER_H__
00002 #define __MOCKSENSORCONTROLLER_H__
00003 
00004 #include "mbed.h"
00005 
00006 #include "SensorController.h"
00007 
00008 class MockSensorController : public SensorController {
00009     public:
00010         MockSensorController(bool threaded, int interval_ms, float (*func)(int, int)) : SensorController(threaded, interval_ms) {
00011             this->func = func;  
00012             t.start();  
00013         }  
00014         
00015         virtual void update();
00016         
00017         virtual float getValue();
00018         
00019         virtual std::string getName();
00020         
00021         virtual void setLed(bool);
00022     
00023     private:
00024         int i;
00025         Timer t;
00026         long int sum_t;
00027         float (*func)(int, int);
00028 };
00029 
00030 #endif