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: HP206C mbed HMC5883L DHT DS1820
main.cpp@46:40b6bbf6167e, 2018-10-01 (annotated)
- Committer:
- MathieuM
- Date:
- Mon Oct 01 10:32:14 2018 +0000
- Revision:
- 46:40b6bbf6167e
- Parent:
- 45:60f602ecd59b
- Child:
- 48:824fda6804f1
updated main
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| MathieuM | 0:fa6e7dd26ef2 | 1 | #include "mbed.h" |
| MathieuM | 45:60f602ecd59b | 2 | #include "config.h" |
| MathieuM | 45:60f602ecd59b | 3 | #include "communication.h" |
| MathieuM | 46:40b6bbf6167e | 4 | #include "T_H_air.h" |
| MathieuM | 0:fa6e7dd26ef2 | 5 | |
| MathieuM | 45:60f602ecd59b | 6 | Serial wisol(SERIAL_PORT); |
| MathieuM | 46:40b6bbf6167e | 7 | DHT sensor(PIN_NAME, DHTtype); |
| MathieuM | 0:fa6e7dd26ef2 | 8 | |
| MathieuM | 0:fa6e7dd26ef2 | 9 | int main() { |
| MathieuM | 0:fa6e7dd26ef2 | 10 | while(1) { |
| MathieuM | 46:40b6bbf6167e | 11 | float airH, airT; |
| MathieuM | 46:40b6bbf6167e | 12 | char *message; |
| MathieuM | 33:2a6476c33e74 | 13 | /* |
| MathieuM | 33:2a6476c33e74 | 14 | read T&H air |
| MathieuM | 33:2a6476c33e74 | 15 | read T sol |
| MathieuM | 33:2a6476c33e74 | 16 | read H sol |
| MathieuM | 33:2a6476c33e74 | 17 | read Pressure |
| MathieuM | 33:2a6476c33e74 | 18 | read Magnetic |
| MathieuM | 33:2a6476c33e74 | 19 | |
| MathieuM | 33:2a6476c33e74 | 20 | m = genMessage(T_air, H_air, T_sol, H_sol, Pressure, Mag) |
| MathieuM | 33:2a6476c33e74 | 21 | sendMessage(m) |
| MathieuM | 33:2a6476c33e74 | 22 | */ |
| MathieuM | 46:40b6bbf6167e | 23 | airH = airHumidity(sensor); |
| MathieuM | 46:40b6bbf6167e | 24 | airT = airTemperature(sensor); |
| MathieuM | 46:40b6bbf6167e | 25 | message = genMessage(airT, airH); |
| MathieuM | 46:40b6bbf6167e | 26 | wisol.printf("AT$SF=%s\r\n", message); |
| MathieuM | 45:60f602ecd59b | 27 | wait(WAIT_TIME); |
| MathieuM | 0:fa6e7dd26ef2 | 28 | } |
| MathieuM | 0:fa6e7dd26ef2 | 29 | } |
