Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed DRV88255 TextLCD Ping mbed-rtos
MockSensorController.h@66:133398875949, 2016-06-20 (annotated)
- Committer:
- joran
- Date:
- Mon Jun 20 10:53:46 2016 +0000
- Revision:
- 66:133398875949
- Parent:
- 57:8dc3192ff150
setLed
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| sbouber1 | 12:c51f3aba84fe | 1 | #ifndef __MOCKSENSORCONTROLLER_H__ |
| sbouber1 | 12:c51f3aba84fe | 2 | #define __MOCKSENSORCONTROLLER_H__ |
| sbouber1 | 12:c51f3aba84fe | 3 | |
| sbouber1 | 12:c51f3aba84fe | 4 | #include "mbed.h" |
| sbouber1 | 12:c51f3aba84fe | 5 | |
| sbouber1 | 12:c51f3aba84fe | 6 | #include "SensorController.h" |
| sbouber1 | 12:c51f3aba84fe | 7 | |
| sbouber1 | 12:c51f3aba84fe | 8 | class MockSensorController : public SensorController { |
| sbouber1 | 12:c51f3aba84fe | 9 | public: |
| sbouber1 | 13:1323e2c0b697 | 10 | MockSensorController(bool threaded, int interval_ms, float (*func)(int, int)) : SensorController(threaded, interval_ms) { |
| sbouber1 | 13:1323e2c0b697 | 11 | this->func = func; |
| sbouber1 | 13:1323e2c0b697 | 12 | t.start(); |
| sbouber1 | 12:c51f3aba84fe | 13 | } |
| sbouber1 | 12:c51f3aba84fe | 14 | |
| sbouber1 | 12:c51f3aba84fe | 15 | virtual void update(); |
| sbouber1 | 12:c51f3aba84fe | 16 | |
| sbouber1 | 12:c51f3aba84fe | 17 | virtual float getValue(); |
| sbouber1 | 12:c51f3aba84fe | 18 | |
| sbouber1 | 57:8dc3192ff150 | 19 | virtual std::string getName(); |
| joran | 66:133398875949 | 20 | |
| joran | 66:133398875949 | 21 | virtual void setLed(bool); |
| sbouber1 | 12:c51f3aba84fe | 22 | |
| sbouber1 | 12:c51f3aba84fe | 23 | private: |
| sbouber1 | 12:c51f3aba84fe | 24 | int i; |
| sbouber1 | 13:1323e2c0b697 | 25 | Timer t; |
| sbouber1 | 13:1323e2c0b697 | 26 | long int sum_t; |
| sbouber1 | 13:1323e2c0b697 | 27 | float (*func)(int, int); |
| sbouber1 | 12:c51f3aba84fe | 28 | }; |
| sbouber1 | 12:c51f3aba84fe | 29 | |
| sbouber1 | 12:c51f3aba84fe | 30 | #endif |