mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 10:42:49 +00:00
Added (excluded) Dropzone Module for more comprehensive module example (#4098)
* DropzoneModule hello world * Buttoning things up * Exclude by default * Upstream refs * Cleanup * Add modules folder to path * Case and path matters * Exclude from header * Guard
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef _MT_DFROBOTLARKSENSOR_H
|
||||
#define _MT_DFROBOTLARKSENSOR_H
|
||||
#include "configuration.h"
|
||||
|
||||
#if !MESHTASTIC_EXCLUDE_ENVIRONMENTAL_SENSOR
|
||||
@@ -21,4 +25,5 @@ class DFRobotLarkSensor : public TelemetrySensor
|
||||
virtual bool getMetrics(meshtastic_Telemetry *measurement) override;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
21
src/modules/Telemetry/UnitConversions.cpp
Normal file
21
src/modules/Telemetry/UnitConversions.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "UnitConversions.h"
|
||||
|
||||
float UnitConversions::CelsiusToFahrenheit(float celcius)
|
||||
{
|
||||
return (celcius * 9) / 5 + 32;
|
||||
}
|
||||
|
||||
float UnitConversions::MetersPerSecondToKnots(float metersPerSecond)
|
||||
{
|
||||
return metersPerSecond * 1.94384;
|
||||
}
|
||||
|
||||
float UnitConversions::MetersPerSecondToMilesPerHour(float metersPerSecond)
|
||||
{
|
||||
return metersPerSecond * 2.23694;
|
||||
}
|
||||
|
||||
float UnitConversions::HectoPascalToInchesOfMercury(float hectoPascal)
|
||||
{
|
||||
return hectoPascal * 0.029529983071445;
|
||||
}
|
||||
10
src/modules/Telemetry/UnitConversions.h
Normal file
10
src/modules/Telemetry/UnitConversions.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
class UnitConversions
|
||||
{
|
||||
public:
|
||||
static float CelsiusToFahrenheit(float celcius);
|
||||
static float MetersPerSecondToKnots(float metersPerSecond);
|
||||
static float MetersPerSecondToMilesPerHour(float metersPerSecond);
|
||||
static float HectoPascalToInchesOfMercury(float hectoPascal);
|
||||
};
|
||||
Reference in New Issue
Block a user