Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SmartHome
NodeManager_GasSensor
Commits
b6401a26
Commit
b6401a26
authored
Apr 12, 2017
by
user2684
Browse files
SensorThermistor class is limited int value #64
parent
dcc7e621
Changes
2
Hide whitespace changes
Inline
Side-by-side
NodeManager.cpp
View file @
b6401a26
...
@@ -394,7 +394,7 @@ SensorThermistor::SensorThermistor(int child_id, int pin): Sensor(child_id, pin)
...
@@ -394,7 +394,7 @@ SensorThermistor::SensorThermistor(int child_id, int pin): Sensor(child_id, pin)
}
}
// setter/getter
// setter/getter
void
SensorThermistor
::
setNominalResistor
(
int
value
)
{
void
SensorThermistor
::
setNominalResistor
(
long
value
)
{
_nominal_resistor
=
value
;
_nominal_resistor
=
value
;
}
}
void
SensorThermistor
::
setNominalTemperature
(
int
value
)
{
void
SensorThermistor
::
setNominalTemperature
(
int
value
)
{
...
@@ -403,7 +403,7 @@ void SensorThermistor::setNominalTemperature(int value) {
...
@@ -403,7 +403,7 @@ void SensorThermistor::setNominalTemperature(int value) {
void
SensorThermistor
::
setBCoefficient
(
int
value
)
{
void
SensorThermistor
::
setBCoefficient
(
int
value
)
{
_b_coefficient
=
value
;
_b_coefficient
=
value
;
}
}
void
SensorThermistor
::
setSeriesResistor
(
int
value
)
{
void
SensorThermistor
::
setSeriesResistor
(
long
value
)
{
_series_resistor
=
value
;
_series_resistor
=
value
;
}
}
void
SensorThermistor
::
setOffset
(
float
value
)
{
void
SensorThermistor
::
setOffset
(
float
value
)
{
...
...
NodeManager.h
View file @
b6401a26
...
@@ -387,13 +387,13 @@ class SensorThermistor: public Sensor {
...
@@ -387,13 +387,13 @@ class SensorThermistor: public Sensor {
public:
public:
SensorThermistor
(
int
child_id
,
int
pin
);
SensorThermistor
(
int
child_id
,
int
pin
);
// resistance at 25 degrees C (default: 10000)
// resistance at 25 degrees C (default: 10000)
void
setNominalResistor
(
int
value
);
void
setNominalResistor
(
long
value
);
// temperature for nominal resistance (default: 25)
// temperature for nominal resistance (default: 25)
void
setNominalTemperature
(
int
value
);
void
setNominalTemperature
(
int
value
);
// The beta coefficient of the thermistor (default: 3950)
// The beta coefficient of the thermistor (default: 3950)
void
setBCoefficient
(
int
value
);
void
setBCoefficient
(
int
value
);
// the value of the resistor in series with the thermistor (default: 10000)
// the value of the resistor in series with the thermistor (default: 10000)
void
setSeriesResistor
(
int
value
);
void
setSeriesResistor
(
long
value
);
// set a temperature offset
// set a temperature offset
void
setOffset
(
float
value
);
void
setOffset
(
float
value
);
// define what to do at each stage of the sketch
// define what to do at each stage of the sketch
...
@@ -402,10 +402,10 @@ class SensorThermistor: public Sensor {
...
@@ -402,10 +402,10 @@ class SensorThermistor: public Sensor {
void
onLoop
();
void
onLoop
();
void
onReceive
(
const
MyMessage
&
message
);
void
onReceive
(
const
MyMessage
&
message
);
protected:
protected:
int
_nominal_resistor
=
10000
;
long
_nominal_resistor
=
10000
;
int
_nominal_temperature
=
25
;
int
_nominal_temperature
=
25
;
int
_b_coefficient
=
3950
;
int
_b_coefficient
=
3950
;
int
_series_resistor
=
10000
;
long
_series_resistor
=
10000
;
float
_offset
=
0
;
float
_offset
=
0
;
};
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment