Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge #12

Merged
merged 3 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}