Sigfox project
Dependencies: mbed TCS34725 WakeUp DHT TSL2561_I2C DS1820
Diff: main.cpp
- Revision:
- 2:e153d5219f93
- Parent:
- 1:07835f780c89
- Child:
- 3:a5b1e083ffd2
--- a/main.cpp Tue Oct 15 08:56:41 2019 +0000 +++ b/main.cpp Tue Oct 15 09:50:21 2019 +0000 @@ -7,6 +7,7 @@ Serial pc(USBTX, USBRX); DHT dht(A1, 22); TCS3472_I2C rgb_sensor( PB_4, PA_7 ); +AnalogIn ain(A0); // humidity sol DS1820 temp_sol(A2); int main(){ @@ -15,6 +16,7 @@ rgb_sensor.enablePowerAndRGBC(); rgb_sensor.setIntegrationTime(100); int rgb_readings[4]; + int hum_sol; //erreur temp_sol @@ -41,7 +43,10 @@ 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 humidite sol + hum_sol = (int)(((0.78 - ain.read())*100)/0.38); + pc.printf ("l'humidite du sol est %d%\n", hum_sol); // humidity sol + //Capteur temperature sol temp_sol.convertTemperature(true, DS1820::all_devices); pc.printf("temperature : %.1f\n", temp_sol.temperature());