-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSensorReading.cpp
60 lines (59 loc) · 1.43 KB
/
SensorReading.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include "Arduino.h"
#include "SensorReading.h"
SensorReading::SensorReading()
{}
SensorReading::SensorReading(int type)
{
this->_type = type;
this->_value = 0;
this->_source = 0;
this->_value_parsed = 0;
this->_boot = 1;
}
SensorReading::SensorReading(int type, int value)
{
this->_type = type;
this->_value = value;
this->_source = 0;
this->_value_parsed = 0;
this->_boot = 1;
}
SensorReading::SensorReading(int type, int value, int source)
{
this->_type = type;
this->_value = value;
this->_source = source;
this->_value_parsed = 0;
this->_boot = 1;
}
SensorReading::SensorReading(int type, int value, int source, float value_parsed)
{
this->_type = type;
this->_value = value;
this->_source = source;
this->_value_parsed = value_parsed;
this->_boot = 1;
}
SensorReading::SensorReading(int type, int value, int source, float value_parsed, int boot)
{
this->_type = type;
this->_value = value;
this->_source = source;
this->_value_parsed = value_parsed;
this->_boot = boot;
}
void SensorReading::display() {
Serial.println("#####");
Serial.println("Sensor Reading");
Serial.print("Type: ");
Serial.println(this->_type);
Serial.print("Value: ");
Serial.println(this->_value);
Serial.print("Value Parsed: ");
Serial.println(this->_value_parsed);
Serial.print("Source: sprout-");
Serial.println(this->_source);
Serial.print("Boot: ");
Serial.println(this->_boot);
Serial.println("#####");
}