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
- Committer:
- MathieuM
- Date:
- 2018-10-08
- Revision:
- 52:d49b6f468b97
- Parent:
- 49:b1ac7ebb715f
- Child:
- 53:a0752606d02c
File content as of revision 52:d49b6f468b97:
#include "mbed.h"
#include "config.h"
#include "communication.h"
#include "T_H_air.h"
#include "altitude.h"
#include "HMC5883L.h"
Serial wisol(SERIAL_PORT);
Serial pc(USBTX, USBRX);
DHT sensor(PIN_NAME, DHTtype);
I2C hp206c(HP20X_I2C_PORT);
HMC5883L hmc5883(HMC5883_I2C_PORT);
int main() {
while(1) {
float airH, airT;
char *message;
int16_t magXYZ[3];
unsigned long alt;
/*
read T&H air
read T sol
read H sol
read Pressure
read Magnetic
m = genMessage(T_air, H_air, T_sol, H_sol, Pressure, Mag)
sendMessage(m)
*/
airH = airHumidity(sensor);
airT = airTemperature(sensor);
//message = genMessage(airT, airH);
//wisol.printf("AT$SF=%s\r\n", message);
alt = readAltitude(&hp206c);
hmc5883.getXYZ(magXYZ);
pc.printf("\n=====| Data |=====\n");
pc.printf("H air : %f\n", airH);
pc.printf("T air : %f\n", airT);
pc.printf("altitude : %lu\n", alt);
pc.printf("Mag : X:%d ; Y:%d ; Z:%d\n", magXYZ[0], magXYZ[1], magXYZ[2]);
wait(1);
}
}
