19 lines
375 B
C++
19 lines
375 B
C++
#pragma once
|
|
|
|
#include <TinySensor.h>
|
|
|
|
class GenericSensor : public TinySensor {
|
|
SensorType sensorType = GENERIC;
|
|
|
|
public:
|
|
GenericSensor(SensorId id) : TinySensor(id) {}
|
|
|
|
void sendValueAndVoltage(int value) {
|
|
sendInfo(ID(id) | VCC(readVcc()) | VALUE(value) | TYPE(sensorType));
|
|
}
|
|
|
|
void sendValue(int value) {
|
|
sendInfo(ID(id) | TEMP(value) | TYPE(sensorType));
|
|
}
|
|
};
|