Skip to content

Commit

Permalink
Merge pull request #12 from aleemont1/emanuele
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
23Emaaaa authored Nov 24, 2023
2 parents c061051 + 81c7107 commit 7ae396e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
29 changes: 29 additions & 0 deletions smart_bridge/src/components/api/Temp.h
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__
9 changes: 9 additions & 0 deletions smart_bridge/src/components/impl/Temp.cpp
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);
}

0 comments on commit 7ae396e

Please sign in to comment.