Version 5
Dependencies: BMP280 TextLCD BME280
main.cpp@4:740cba3f2716, 2018-11-27 (annotated)
- Committer:
- O_Thom
- Date:
- Tue Nov 27 12:51:34 2018 +0000
- Revision:
- 4:740cba3f2716
- Parent:
- 2:38d31b2e0956
- Child:
- 5:f87129ac8bf3
Publish Attempt;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
O_Thom | 0:f9a18207d99c | 1 | /* Sampling Code */ |
O_Thom | 0:f9a18207d99c | 2 | #include "mbed.h" |
O_Thom | 0:f9a18207d99c | 3 | #include "sample_hardware.hpp" |
O_Thom | 0:f9a18207d99c | 4 | #include "Sampler.hpp" |
O_Thom | 0:f9a18207d99c | 5 | |
O_Thom | 0:f9a18207d99c | 6 | |
O_Thom | 0:f9a18207d99c | 7 | Sampler s; // Initialise the s object |
O_Thom | 2:38d31b2e0956 | 8 | Ticker t; // Time Initialisation |
O_Thom | 2:38d31b2e0956 | 9 | |
O_Thom | 2:38d31b2e0956 | 10 | void doISR() |
O_Thom | 2:38d31b2e0956 | 11 | { |
O_Thom | 2:38d31b2e0956 | 12 | s.activate(); // Signal the sampling thread to move from WAITING to READY |
O_Thom | 2:38d31b2e0956 | 13 | } |
O_Thom | 2:38d31b2e0956 | 14 | |
O_Thom | 0:f9a18207d99c | 15 | |
O_Thom | 0:f9a18207d99c | 16 | int main() |
O_Thom | 0:f9a18207d99c | 17 | { |
O_Thom | 4:740cba3f2716 | 18 | |
O_Thom | 4:740cba3f2716 | 19 | s.sampEQueue.call_every(1000, &Sampler::publishSample); // Publish sample |
O_Thom | 4:740cba3f2716 | 20 | |
O_Thom | 4:740cba3f2716 | 21 | s.sampEQueue.dispatch(); |
O_Thom | 0:f9a18207d99c | 22 | } |
O_Thom | 2:38d31b2e0956 | 23 |