T-DEV-811/IOT/lib/Capteur/src/Ultrason.cpp

19 lines
389 B
C++

#include "../include/Ultrason.h"
Ultrason::Ultrason(int trigeur, int echo, String fullVall):
Capteur("D",fullVall){
this->capteur = new Ultrasonic(trigeur, echo);
}
String Ultrason::read(){
int sortie = this->capteur->read();
if (sortie > this->fullVall.toInt())
{
this->full = true;
}else{
this->full = false;
}
return String(sortie);
}