-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEarthSystem.cpp
More file actions
46 lines (37 loc) · 1.02 KB
/
EarthSystem.cpp
File metadata and controls
46 lines (37 loc) · 1.02 KB
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
#include "EarthSystem.hpp"
String EarthSystem::GetSummary(){
this->Summary = this->GetTemperature();
this->Summary += "C,\n";
this->Summary += this->GetHumidity();
this->Summary += "% humidity,\n";
this->Summary += this->GetPressure();
this->Summary += "hPa,\n";
this->Summary += "Altitude: ";
this->Summary += this->GetAltitude();
this->Summary += "meters";
return this->Summary;
}
float EarthSystem::GetTemperature(){
return this->GetTemperatureCelsius();
}
float EarthSystem::GetTemperatureCelsius(){
return this->Station.readTemperature();
}
float EarthSystem::GetTemperatureFahrenheit(){
return this->Station.readTemperature();
}
float EarthSystem::GetHumidity(){
return this->Station.readHumidity();
}
float EarthSystem::GetPressure(){
return this->Station.readPressure() / 100.0F;
}
float EarthSystem::GetAltitude(){
return this->Station.readAltitude(SEALEVELPRESSURE_HPA);
}
bool EarthSystem::init(){
return this->Station.begin();
}
EarthSystem::EarthSystem(){
this->Station.begin();
}