add debug poids

This commit is contained in:
Clement 2023-05-09 10:26:50 +02:00
parent 922d6e85f0
commit 107ca935b8
2 changed files with 10 additions and 7 deletions

View File

@ -41,13 +41,14 @@ boolean Balance::calibration(int poidsRef,int moyenne_calibration) {
} }
String Balance::read() { String Balance::read() {
int sortie = (int)this->capteur->get_units();
this->full = sortie > this->fullVall.toInt();
if (this->initialized == true) { if (this->initialized == true) {
return String(this->capteur->get_units()); return String(sortie);
} else { } else {
return "0"; return "0";
} }
} }//TODO: update isfull
bool Balance::tar(int val){ bool Balance::tar(int val){
this->initialized = true; this->initialized = true;

View File

@ -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");//TODO: mettre la valeur en config this->dht = new HumiTemp(DHTPIN, DHTTYPE, "20:30/60:80");//TODO: mettre la valeur en config
this->balance = new Balance(POID_DOUT,POID_SCK,"500");//TODO: mettre la valter en donfig this->balance = new Balance(POID_DOUT,POID_SCK,"100");//TODO: mettre la valter en donfig
this->balance->tar(1077); this->balance->tar(1077);
} }
@ -28,12 +28,14 @@ void Program::loop(){
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()); //this->api->sendValue(humitemp, TRASHCAN_TWO, this->dht->getValType(), this->dht->isFull());
Serial.print("humiTemp = " + this->dht->read()); Serial.print("humiTemp = " + humitemp);
Serial.println(this->dht->isFull()?" true":" false"); Serial.println(this->dht->isFull()?" true":" false");
//this->api->sendValue(poid, TRASHCAN_TWO, this->balance->getValType(), this->balance->isFull()); //this->api->sendValue(poid, TRASHCAN_TWO, this->balance->getValType(), this->balance->isFull());
Serial.print("humiTemp = " + this->dht->read()); Serial.print("poid = " + poid);
Serial.println(this->dht->isFull()?" true":" false"); Serial.println(this->balance->isFull()?" true":" false");
Serial.println();
delay(1000); delay(1000);
} }