feat: création classe abstraite capteur #44
@ -7,8 +7,8 @@ Program::Program(){
|
||||
Serial.begin(MONITOR_SPEED);
|
||||
|
||||
////////API///////
|
||||
//this->api = new API(USER_NAME, USER_PASSWORD, API_HOST);
|
||||
//this->api->wifiBegin(WIFI_SSID, WIFI_PASSWORD, &Serial1);
|
||||
this->api = new API(USER_NAME, USER_PASSWORD, API_HOST);
|
||||
this->api->wifiBegin(WIFI_SSID, WIFI_PASSWORD, &Serial1);
|
||||
|
||||
//////CAPTEUR/////
|
||||
this->ultrasonic = new Ultrason(ULTRA_SOUND_TRIGD, ULTRA_SOUND_ECHO, String(10));//TODO: mettre la valeur en config
|
||||
@ -17,7 +17,7 @@ Program::Program(){
|
||||
void Program::loop(){
|
||||
String distance = this->ultrasonic->read();
|
||||
|
||||
//this->api->sendValue(distance, TRASHCAN_ONE, "W", false);
|
||||
this->api->sendValue(distance, TRASHCAN_ONE, "D", this->ultrasonic->isFull());
|
||||
Serial.print("Distance in CM: ");
|
||||
Serial.print(distance);
|
||||
Serial.println(this->ultrasonic->isFull());
|
||||
|
Loading…
x
Reference in New Issue
Block a user