Sigfox project
Dependencies: mbed TCS34725 WakeUp DHT TSL2561_I2C DS1820
Diff: main.cpp
- Revision:
- 1:07835f780c89
- Parent:
- 0:cfed96a14467
- Child:
- 2:e153d5219f93
--- a/main.cpp Tue Oct 15 06:51:33 2019 +0000 +++ b/main.cpp Tue Oct 15 08:56:41 2019 +0000 @@ -1,15 +1,13 @@ #include "mbed.h" - +#include "DS1820.h" #include "DHT.h" - #include "TCS3472_I2C.h" //DigitalOut led(LED3); Serial pc(USBTX, USBRX); - DHT dht(A1, 22); - TCS3472_I2C rgb_sensor( PB_4, PA_7 ); +DS1820 temp_sol(A2); int main(){ @@ -19,20 +17,35 @@ int rgb_readings[4]; + //erreur temp_sol + if(temp_sol.unassignedProbe(A2)) + { + pc.printf("error temperature_sol"); + } + while(1){ + //Capteur air + //data = dht.readData(); - data = dht.readData(); - rgb_sensor.getAllColors(rgb_readings); + + //Capteur RGB + + /*rgb_sensor.getAllColors(rgb_readings); //led = !led; if(data == ERROR_NONE){ pc.printf("La temperature de la salle est: %.2f et Humidite est: %.2f\n", dht.ReadTemperature(CELCIUS), dht.ReadHumidity()); } else{ //pc.printf("Erreur numero: %d\n", data); - } + } + pc.printf( "red: %d, green: %d, blue: %d, clear: %d\n", rgb_readings[0], rgb_readings[1], rgb_readings[2], rgb_readings[3] ); + wait_ms(5000);*/ + - pc.printf( "red: %d, green: %d, blue: %d, clear: %d\n", rgb_readings[0], rgb_readings[1], rgb_readings[2], rgb_readings[3] ); - wait_ms(5000); + //Capteur temperature sol + temp_sol.convertTemperature(true, DS1820::all_devices); + pc.printf("temperature : %.1f\n", temp_sol.temperature()); + wait(3); } } \ No newline at end of file