22 lines
417 B
C++
22 lines
417 B
C++
#pragma once
|
|
|
|
#include <TinySensor.h>
|
|
#include <RCSwitch.h>
|
|
|
|
class TempSensor: public TinySensor {
|
|
SensorType sensorType = TEMPERATURE;
|
|
|
|
public:
|
|
TempSensor(short id, short senderPin) :
|
|
TinySensor(id, senderPin) {
|
|
}
|
|
|
|
void sendTempAndVoltage(int temp) {
|
|
sendInfo(ID(id) | VCC(readVcc()) | TEMP(temp) | TYPE(sensorType));
|
|
}
|
|
|
|
void sendTemp(int temp) {
|
|
sendInfo(ID(id) | TEMP(temp) | TYPE(sensorType));
|
|
}
|
|
};
|