-
Notifications
You must be signed in to change notification settings - Fork 5
/
TempSensorDecode.h
45 lines (37 loc) · 1.12 KB
/
TempSensorDecode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
TempSensorDecode.h - Library for decoding
prologue temperature sensor data from inexpensive
433 MHz based weather sensors.
Created by Martin Marinov, 2020
Released into the public domain.
*/
#ifndef TempSensorDecode_h
#define WTempSensorDecode_h
#include "Arduino.h"
class TempSensorDecode
{
public:
static void setup(int pin);
static bool hasNewData();
static bool hasAnyData();
static float getTemperature();
static uint8_t getHumidity();
static bool getIsButtonPressed();
static uint8_t getBatteryState();
static uint8_t getChannel();
static uint64_t getRawPacket();
private:
TempSensorDecode() {}
static volatile int16_t _temperature_raw;
static volatile uint8_t _humidity;
static volatile bool _isButtonPressed;
static volatile uint8_t _batteryState;
static volatile uint8_t _channel;
static volatile bool _hasNewData;
static volatile bool _hasAnyData;
static volatile uint64_t _packet_raw;
static void _handleInterrupt();
static void _handleDuration(unsigned long duration);
static void _handlePacket(uint64_t packet);
};
#endif