feat: implemente ultrasond in Capteur

This commit is contained in:
2023-05-02 11:07:38 +02:00
parent e8b420f3f7
commit aed8706921
2 changed files with 57 additions and 0 deletions

View File

@ -0,0 +1,19 @@
#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);
}