Sigfox project
Dependencies: mbed TCS34725 WakeUp DHT TSL2561_I2C DS1820
main.cpp
- Committer:
- ran_ghe
- Date:
- 2019-10-15
- Revision:
- 1:07835f780c89
- Parent:
- 0:cfed96a14467
- Child:
- 2:e153d5219f93
File content as of revision 1:07835f780c89:
#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(){ int data; rgb_sensor.enablePowerAndRGBC(); rgb_sensor.setIntegrationTime(100); int rgb_readings[4]; //erreur temp_sol if(temp_sol.unassignedProbe(A2)) { pc.printf("error temperature_sol"); } while(1){ //Capteur air //data = dht.readData(); //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);*/ //Capteur temperature sol temp_sol.convertTemperature(true, DS1820::all_devices); pc.printf("temperature : %.1f\n", temp_sol.temperature()); wait(3); } }