diff --git a/smart_bridge/src/components/api/Temp.h b/smart_bridge/src/components/api/Temp.h new file mode 100644 index 0000000..7b7f869 --- /dev/null +++ b/smart_bridge/src/components/api/Temp.h @@ -0,0 +1,29 @@ +#ifndef __TEMP__ +#define __TEMP__ + +/** + * @class Temp + * @brief This class represents a temperature sensor. + * + * It provides functionalities to get the temperature. + */ +class Temp +{ + +public: + /** + * @brief Construct a new Temp object + * + * @param pin The pin number where the temperature sensor is connected. + */ + Temp(int pin); + +private: + /** + * @brief The pin number where the temperature sensor is connected. + * + */ + int tempPin; +}; + +#endif // __TEMP__ diff --git a/smart_bridge/src/components/impl/Temp.cpp b/smart_bridge/src/components/impl/Temp.cpp new file mode 100644 index 0000000..4b0e17f --- /dev/null +++ b/smart_bridge/src/components/impl/Temp.cpp @@ -0,0 +1,9 @@ +#include "../api/Temp.h" +#include "config/config.h" +#include "Arduino.h" + +Temp::Temp(int pin) +{ + this->tempPin = TMP_PIN; + pinMode(tempPin, INPUT); +} \ No newline at end of file