-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} |