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@48:824fda6804f1, 2018-10-02 (annotated)
- Committer:
- MathieuM
- Date:
- Tue Oct 02 13:51:25 2018 +0000
- Revision:
- 48:824fda6804f1
- Parent:
- 46:40b6bbf6167e
- Child:
- 49:b1ac7ebb715f
move SSD1306 class
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 | 48:824fda6804f1 | 5 | #include "ssd1306.h" | 
| MathieuM | 48:824fda6804f1 | 6 | #include "standard_font.h" | 
| MathieuM | 48:824fda6804f1 | 7 | #include "bold_font.h" | 
| MathieuM | 0:fa6e7dd26ef2 | 8 | |
| MathieuM | 45:60f602ecd59b | 9 | Serial wisol(SERIAL_PORT); | 
| MathieuM | 46:40b6bbf6167e | 10 | DHT sensor(PIN_NAME, DHTtype); | 
| MathieuM | 48:824fda6804f1 | 11 | SSD1306 screen(D11, D9, D13, A4, D2); | 
| MathieuM | 0:fa6e7dd26ef2 | 12 | |
| MathieuM | 0:fa6e7dd26ef2 | 13 | int main() { | 
| MathieuM | 48:824fda6804f1 | 14 | screen.initialise(); | 
| MathieuM | 48:824fda6804f1 | 15 | screen.clear(); | 
| MathieuM | 48:824fda6804f1 | 16 | screen.set_contrast(255); // max contrast | 
| MathieuM | 48:824fda6804f1 | 17 | screen.set_font(bold_font, 6); | 
| MathieuM | 0:fa6e7dd26ef2 | 18 | while(1) { | 
| MathieuM | 46:40b6bbf6167e | 19 | float airH, airT; | 
| MathieuM | 46:40b6bbf6167e | 20 | char *message; | 
| MathieuM | 33:2a6476c33e74 | 21 | /* | 
| MathieuM | 33:2a6476c33e74 | 22 | read T&H air | 
| MathieuM | 33:2a6476c33e74 | 23 | read T sol | 
| MathieuM | 33:2a6476c33e74 | 24 | read H sol | 
| MathieuM | 33:2a6476c33e74 | 25 | read Pressure | 
| MathieuM | 33:2a6476c33e74 | 26 | read Magnetic | 
| MathieuM | 33:2a6476c33e74 | 27 | |
| MathieuM | 33:2a6476c33e74 | 28 | m = genMessage(T_air, H_air, T_sol, H_sol, Pressure, Mag) | 
| MathieuM | 33:2a6476c33e74 | 29 | sendMessage(m) | 
| MathieuM | 33:2a6476c33e74 | 30 | */ | 
| MathieuM | 48:824fda6804f1 | 31 | //airH = airHumidity(sensor); | 
| MathieuM | 48:824fda6804f1 | 32 | //airT = airTemperature(sensor); | 
| MathieuM | 48:824fda6804f1 | 33 | //message = genMessage(airT, airH); | 
| MathieuM | 48:824fda6804f1 | 34 | //wisol.printf("AT$SF=%s\r\n", message); | 
| MathieuM | 48:824fda6804f1 | 35 | screen.printf("test"); | 
| MathieuM | 48:824fda6804f1 | 36 | screen.update(); | 
| MathieuM | 45:60f602ecd59b | 37 | wait(WAIT_TIME); | 
| MathieuM | 0:fa6e7dd26ef2 | 38 | } | 
| MathieuM | 0:fa6e7dd26ef2 | 39 | } | 
