mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-22 10:42:49 +00:00
I don't like this formatting but I need trunk to STFU
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
||||
#include "configuration.h"
|
||||
#include "TelemetrySensor.h"
|
||||
#include "MCP9808Sensor.h"
|
||||
#include "../mesh/generated/meshtastic/telemetry.pb.h"
|
||||
#include "TelemetrySensor.h"
|
||||
#include "configuration.h"
|
||||
#include <Adafruit_MCP9808.h>
|
||||
|
||||
MCP9808Sensor::MCP9808Sensor() :
|
||||
TelemetrySensor(TelemetrySensorType_MCP9808, "MCP9808")
|
||||
{
|
||||
}
|
||||
MCP9808Sensor::MCP9808Sensor() : TelemetrySensor(TelemetrySensorType_MCP9808, "MCP9808") {}
|
||||
|
||||
int32_t MCP9808Sensor::runOnce() {
|
||||
int32_t MCP9808Sensor::runOnce()
|
||||
{
|
||||
LOG_INFO("Init sensor: %s\n", sensorName);
|
||||
if (!hasSensor()) {
|
||||
return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS;
|
||||
@@ -18,12 +16,14 @@ int32_t MCP9808Sensor::runOnce() {
|
||||
return initI2CSensor();
|
||||
}
|
||||
|
||||
void MCP9808Sensor::setup() {
|
||||
void MCP9808Sensor::setup()
|
||||
{
|
||||
mcp9808.setResolution(2);
|
||||
}
|
||||
|
||||
bool MCP9808Sensor::getMetrics(Telemetry *measurement) {
|
||||
bool MCP9808Sensor::getMetrics(Telemetry *measurement)
|
||||
{
|
||||
LOG_DEBUG("MCP9808Sensor::getMetrics\n");
|
||||
measurement->variant.environment_metrics.temperature = mcp9808.readTempC();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user