Etienne Charbonnier
/
plant_monitoring
Plant Monitoring CS
Diff: main.cpp
- Revision:
- 62:4763f2aa486c
- Parent:
- 61:700f3f204adc
diff -r 700f3f204adc -r 4763f2aa486c main.cpp --- a/main.cpp Wed Mar 25 16:06:17 2020 +0000 +++ b/main.cpp Thu Mar 26 10:01:31 2020 +0000 @@ -18,7 +18,7 @@ #include "TCPSocket.h" #include "HTS221Sensor.h" #include "DHT22.h" -#include "TSL2591.h" +#include "TSL2561.h" #define WIFI_IDW0XX1 2 #define UBIDOTS_TOKEN "BBFF-xp89MM8kmzzbp6eJ074XjDpqz7qryh" @@ -96,11 +96,11 @@ AnalogIn adc_temp(ADC_TEMP); // Internal Temp Sensor to ADC Channel AnalogIn adc_vbat(ADC_VBAT); // VBAT / 3 internal to ADC channel - static DevI2C devI2c(PB_11,PB_10); - // static HTS221Sensor sen_hum_temp(&devI2c); + // static DevI2C devI2c(PB_11,PB_10); + // static DevI2C devI2c(D14,D15); + //static HTS221Sensor sen_hum_temp(&devI2c); static DHT22 tempSensor(D2); // Vérifier que le capteur DHT22 est relié au PIN D2 - static I2C i2c1(I2C_SDA, I2C_SCL); - static TSL2591 sensor1(i2c1, TSL2591_ADDR); // Vérifier que le capteur TSL2591 est bien relié aux ports SDA et SCL + static TSL2561 LUM(PB_11, PB_10); // Vérifier que le capteur TSL2591 est bien relié aux ports SDA et SCL static AnalogIn analog_value(A0); // Vérifier que le capteur d'humidité du sol est bien relié au port analogique A0 //sen_hum_temp.init(NULL); @@ -136,9 +136,7 @@ h = (float) tempSensor.getHumidity(); hum = h/10; printf("Luminosity acquisition\n"); - sensor1.getALS(); - sensor1.calcLux(); - lux = (float) sensor1.full; + lux = (float) LUM.lux(); printf("Soil moisture acquisition\n"); moist_r = analog_value.read(); printf("Soil moisture conversion\n");