add balance to main program
This commit is contained in:
parent
e939ee757d
commit
36dd744da5
@ -44,9 +44,7 @@ private:
|
|||||||
* @brief capteur poid pour le niveau de remplissage de la poubelle
|
* @brief capteur poid pour le niveau de remplissage de la poubelle
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
Balance *balance;
|
Capteur *balance;
|
||||||
|
|
||||||
//TODO chagé type to capteur
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Réference de l'API pour les calls
|
* @brief Réference de l'API pour les calls
|
||||||
|
@ -14,14 +14,14 @@ 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
|
||||||
//TODO: init balance
|
this->balance->tar(1077);
|
||||||
//calibration factor : 1077
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Program::loop(){
|
void Program::loop(){
|
||||||
String distance = this->ultrasonic->read();
|
String distance = this->ultrasonic->read();
|
||||||
String humitemp = this->dht->read();
|
String humitemp = this->dht->read();
|
||||||
|
String poid = this->balance->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 = " + distance);
|
Serial.print("Distance in CM = " + distance);
|
||||||
@ -32,6 +32,9 @@ void Program::loop(){
|
|||||||
Serial.println(this->dht->isFull()?" true":" false");
|
Serial.println(this->dht->isFull()?" true":" false");
|
||||||
|
|
||||||
//TODO: Lire balance
|
//TODO: Lire balance
|
||||||
|
//this->api->sendValue(poid, TRASHCAN_TWO, this->balance->getValType(), this->balance->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