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: BMP280 ELEC350-Practicals-FZ429 TextLCD BME280 ntp-client
Sampler.cpp@5:f87129ac8bf3, 2018-11-29 (annotated)
- Committer:
- O_Thom
- Date:
- Thu Nov 29 16:08:28 2018 +0000
- Revision:
- 5:f87129ac8bf3
Commit before change from sample message class to typedef struct
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| O_Thom | 5:f87129ac8bf3 | 1 | #include "mbed.h" |
| O_Thom | 5:f87129ac8bf3 | 2 | #include "sample_hardware.hpp" |
| O_Thom | 5:f87129ac8bf3 | 3 | #include "Sampler.hpp" |
| O_Thom | 5:f87129ac8bf3 | 4 | |
| O_Thom | 5:f87129ac8bf3 | 5 | Sampler m_os; // Initialise the s object |
| O_Thom | 5:f87129ac8bf3 | 6 | |
| O_Thom | 5:f87129ac8bf3 | 7 | void SAMP_Thread() |
| O_Thom | 5:f87129ac8bf3 | 8 | { |
| O_Thom | 5:f87129ac8bf3 | 9 | while(1) |
| O_Thom | 5:f87129ac8bf3 | 10 | { |
| O_Thom | 5:f87129ac8bf3 | 11 | SAMP_Queue.call_every(1000, &m_os, &Sampler::publishSample); // Publish sample |
| O_Thom | 5:f87129ac8bf3 | 12 | SAMP_Queue.dispatch(); |
| O_Thom | 5:f87129ac8bf3 | 13 | while(true) { // Flash if the event queue is exited. |
| O_Thom | 5:f87129ac8bf3 | 14 | yellowLED = 1; |
| O_Thom | 5:f87129ac8bf3 | 15 | wait(0.5); |
| O_Thom | 5:f87129ac8bf3 | 16 | yellowLED = 0; |
| O_Thom | 5:f87129ac8bf3 | 17 | wait(0.1); |
| O_Thom | 5:f87129ac8bf3 | 18 | } |
| O_Thom | 5:f87129ac8bf3 | 19 | } |
| O_Thom | 5:f87129ac8bf3 | 20 | } |