feat: création classe abstraite capteur #44
@ -14,7 +14,7 @@ Program::Program(){
|
|||||||
//////CAPTEUR/////
|
//////CAPTEUR/////
|
||||||
this->ultrasonic = new Ultrason(ULTRA_SOUND_TRIGD, ULTRA_SOUND_ECHO, "10");//TODO: mettre la valeur en config
|
this->ultrasonic = new Ultrason(ULTRA_SOUND_TRIGD, ULTRA_SOUND_ECHO, "10");//TODO: mettre la valeur en config
|
||||||
|
|
||||||
this->dht = new HumiTemp(DHTPIN, DHTTYPE, "20:30/60:80");
|
this->dht = new HumiTemp(DHTPIN, DHTTYPE, "20:30/60:80");//TODO: mettre la valeur en config
|
||||||
}
|
}
|
||||||
|
|
||||||
void Program::loop(){
|
void Program::loop(){
|
||||||
@ -22,12 +22,12 @@ void Program::loop(){
|
|||||||
|
|
||||||
//TODO: envoyer les infos des capteur par la suite
|
//TODO: envoyer les infos des capteur par la suite
|
||||||
|
|
||||||
Serial.println("Temperature = " + String(dht->readTemperature())+" °C");
|
Serial.println("humiTemp = " + this->dht->read());
|
||||||
Serial.println("Humidite = " + String(dht->readHumidity())+" %");
|
|
||||||
|
|
||||||
//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: ");
|
||||||
Serial.print(distance);
|
Serial.print(distance);
|
||||||
Serial.println(this->ultrasonic->isFull()?" true":" false");
|
Serial.println(this->ultrasonic->isFull()?" true":" false");
|
||||||
|
|
||||||
delay(1000);
|
delay(1000);
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user