Compare commits
No commits in common. "c89b6d14799414e968dbf55bdc7f6bbe978bb78a" and "60ec85a572fb49920ced9ff69900cb81f8d33674" have entirely different histories.
c89b6d1479
...
60ec85a572
@ -1,34 +0,0 @@
|
|||||||
#ifndef HUMI_TEMP_H
|
|
||||||
#define HUMI_TEMP_H
|
|
||||||
|
|
||||||
#include <Arduino.h>
|
|
||||||
#include <DHT.h>
|
|
||||||
#include "Capteur.h"
|
|
||||||
|
|
||||||
class HumiTemp : public Capteur{
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Construct a new Humi Temp object
|
|
||||||
*
|
|
||||||
* @param pin pin du capteur dht
|
|
||||||
* @param type type de capteur dht (11,22,...)
|
|
||||||
* @param fullVal valeur au quel la poubelle est considéré comme pleinne
|
|
||||||
*/
|
|
||||||
HumiTemp(int pin, String type, String fullVall);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief lit le capteur d'humi/temp
|
|
||||||
*
|
|
||||||
* @return String valeur format "XX/YY" X% et Y°C
|
|
||||||
*/
|
|
||||||
String read();
|
|
||||||
private:
|
|
||||||
|
|
||||||
DHT* capteur;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif //HUMI_TEMP_H
|
|
@ -1,27 +0,0 @@
|
|||||||
#include "../include/HumiTemp.h"
|
|
||||||
|
|
||||||
|
|
||||||
HumiTemp::HumiTemp(int pin, String type, String fullVall):
|
|
||||||
Capteur("H/T",fullVall){
|
|
||||||
this->capteur = new DHT(pin,type);
|
|
||||||
this->capteur->begin();
|
|
||||||
}
|
|
||||||
|
|
||||||
String HumiTemp::read(){
|
|
||||||
String sortie = "";
|
|
||||||
int hum = this->capteur->readHumidity(true);
|
|
||||||
int temp = this->capteur->readTemperature(false,true);
|
|
||||||
|
|
||||||
//valeur pour un élevage d'astico de pèche selon chatGPT
|
|
||||||
if((temp > 20 && temp < 30) && (hum > 60 && hum < 80)){
|
|
||||||
this->full = true;
|
|
||||||
}else{
|
|
||||||
this->full = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
sortie += String(hum);
|
|
||||||
sortie += "/";
|
|
||||||
sortie += String(temp);
|
|
||||||
return sortie;
|
|
||||||
}
|
|
||||||
//TODO: faire en soirte qu'il y ai un nombre de cycle pour l'aparition d'asticots (entre 1 et 3 jours)
|
|
@ -16,4 +16,4 @@ String Ultrason::read(){
|
|||||||
this->full = false;
|
this->full = false;
|
||||||
}
|
}
|
||||||
return String(sortie);
|
return String(sortie);
|
||||||
}//TODO: faire en sorte que full se reset avec une autre val
|
}
|
Loading…
x
Reference in New Issue
Block a user