Skip to content

Commit

Permalink
Added Farenheit unit
Browse files Browse the repository at this point in the history
  • Loading branch information
qfisch committed Sep 9, 2024
1 parent 1a5d359 commit 8020c55
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Measurement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ void printMeasurementWithoutMetaData(const Measurement &measurement) {
Serial.printf(" Value:\t\t");
switch (measurement.signalType) {
case SignalType::TEMPERATURE_DEGREES_CELSIUS:
case SignalType::TEMPERATURE_DEGREES_FARENHEIT:
case SignalType::RELATIVE_HUMIDITY_PERCENTAGE:
case SignalType::VELOCITY_METERS_PER_SECOND:
Serial.printf("%.1f\n", measurement.dataPoint.value);
Expand Down
3 changes: 3 additions & 0 deletions src/SignalType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const char *unitOf(SignalType signalType) {
switch (signalType) {
case SignalType::TEMPERATURE_DEGREES_CELSIUS:
return "degC";
case SignalType::TEMPERATURE_DEGREES_FARENHEIT:
return "degF";
case SignalType::RELATIVE_HUMIDITY_PERCENTAGE:
return "%";
case SignalType::CO2_PARTS_PER_MILLION:
Expand Down Expand Up @@ -38,6 +40,7 @@ const char *unitOf(SignalType signalType) {
const char *quantityOf(SignalType signalType) {
switch (signalType) {
case SignalType::TEMPERATURE_DEGREES_CELSIUS:
case SignalType::TEMPERATURE_DEGREES_FARENHEIT:
return "T";
case SignalType::RELATIVE_HUMIDITY_PERCENTAGE:
return "RH";
Expand Down
1 change: 1 addition & 0 deletions src/SignalType.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
enum class SignalType {
UNDEFINED,
TEMPERATURE_DEGREES_CELSIUS,
TEMPERATURE_DEGREES_FARENHEIT,
RELATIVE_HUMIDITY_PERCENTAGE,
CO2_PARTS_PER_MILLION,
HCHO_PARTS_PER_BILLION,
Expand Down

0 comments on commit 8020c55

Please sign in to comment.