feat: création classe abstraite capteur #44
@ -24,6 +24,7 @@ public:
|
|||||||
* @return String valeur format "XX/YY" X% et Y°C
|
* @return String valeur format "XX/YY" X% et Y°C
|
||||||
*/
|
*/
|
||||||
String read();
|
String read();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
DHT* capteur;
|
DHT* capteur;
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
#include "../include/HumiTemp.h"
|
#include "../include/HumiTemp.h"
|
||||||
|
|
||||||
|
|
||||||
HumiTemp::HumiTemp(int pin, String type, String fullVall):
|
HumiTemp::HumiTemp(int pin, String type, String fullVall):
|
||||||
Capteur("H/T",fullVall){
|
Capteur("H/T",fullVall){
|
||||||
this->capteur = new DHT(pin,type);
|
this->capteur = new DHT(pin, type.c_str());
|
||||||
this->capteur->begin();
|
this->capteur->begin();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,15 +19,15 @@ Program::Program(){
|
|||||||
|
|
||||||
void Program::loop(){
|
void Program::loop(){
|
||||||
String distance = this->ultrasonic->read();
|
String distance = this->ultrasonic->read();
|
||||||
|
String humitemp = this->dht->read();
|
||||||
//TODO: envoyer les infos des capteur par la suite
|
|
||||||
|
|
||||||
Serial.println("humiTemp = " + this->dht->read());
|
|
||||||
|
|
||||||
//this->api->sendValue(distance, TRASHCAN_ONE, this->ultrasonic->getValType(), this->ultrasonic->isFull());
|
//this->api->sendValue(distance, TRASHCAN_ONE, this->ultrasonic->getValType(), this->ultrasonic->isFull());
|
||||||
Serial.print("Distance in CM: ");
|
Serial.print("Distance in CM = " + distance);
|
||||||
Serial.print(distance);
|
|
||||||
Serial.println(this->ultrasonic->isFull()?" true":" false");
|
Serial.println(this->ultrasonic->isFull()?" true":" false");
|
||||||
|
|
||||||
|
//this->api->sendValue(humitemp, TRASHCAN_TWO, this->dht->getValType(), this->dht->isFull());
|
||||||
|
Serial.print("humiTemp = " + this->dht->read());
|
||||||
|
Serial.println(this->dht->isFull()?" true":" false");
|
||||||
|
|
||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user