TemperatureInterface.cpp 760 B

123456789101112131415161718192021222324252627282930313233343536
  1. #include "TemperatureInterface.h"
  2. #ifdef __cplusplus
  3. extern "C" {
  4. #endif
  5. uint8_t temprature_sens_read();
  6. #ifdef __cplusplus
  7. }
  8. #endif
  9. uint8_t temprature_sens_read();
  10. TemperatureInterface::TemperatureInterface() {
  11. }
  12. void TemperatureInterface::RunSetup() {
  13. this->initTime = millis();
  14. this->current_temp = this->getCurrentTemp();
  15. }
  16. uint8_t TemperatureInterface::getCurrentTemp() {
  17. #ifndef MARAUDER_FLIPPER
  18. return ((temprature_sens_read() - 32) / 1.8);
  19. #endif
  20. return 0;
  21. }
  22. void TemperatureInterface::main(uint32_t currentTime) {
  23. if (currentTime != 0) {
  24. if (currentTime - initTime >= 100) {
  25. //Serial.println("Checking Battery Level");
  26. this->initTime = millis();
  27. this->current_temp = this->getCurrentTemp();
  28. }
  29. }
  30. }