You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

52 lines
859 B

  1. #ifndef THERMOMETER_H
  2. #define THERMOMETER_H
  3. #include <Arduino.h>
  4. #include <Spirulerie.h>
  5. #include "App.h"
  6. //#include "Adafruit_Sensor.h"
  7. //#include "DHT.h"
  8. #define READING_DELAY 3000 //30000
  9. class Thermometer
  10. {
  11. public:
  12. // Methods
  13. Thermometer();
  14. virtual bool StartDevice();
  15. virtual float GetTemperature();
  16. };
  17. class DS18B20Sensor : Thermometer
  18. {
  19. protected:
  20. OneWire oneWire;
  21. DallasTemperature DS18B20;
  22. DeviceAddress adress;
  23. public:
  24. DS18B20Sensor();
  25. bool StartDevice() override;
  26. float GetTemperature() override;
  27. };
  28. /*
  29. class AM2302Sensor : Thermometer
  30. {
  31. protected:
  32. DHT DHTSensor;
  33. public:
  34. AM2302Sensor();
  35. bool StartDevice() override;
  36. float GetTemperature() override;
  37. };
  38. */
  39. // Functions
  40. TaskHandle_t InitThermometer(); // entry point
  41. void ThermometerTask(void *parameter); // RTOS task loop
  42. #endif