-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename WTDecoder.h to Funkthermometer/WTDecoder.h
- Loading branch information
Showing
1 changed file
with
41 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
#include <Arduino.h> | ||
|
||
#define WTD_DEBUG | ||
//#define WTD_DEBUG_VERBOSE | ||
//#define VALID_TX_ID_ONLY | ||
|
||
// WeMos D1 mini | ||
#define INT_PIN D2 // GPIO0 | ||
#ifdef WTD_DEBUG | ||
#define LED_PIN D4 // GPIO2 | ||
#endif | ||
|
||
#define MAX_CODES 20 | ||
#define MAX_RECORDS 20 | ||
|
||
class WTDecoder { | ||
public: | ||
struct rec | ||
{ | ||
bool valid; // record is valid | ||
byte txid; // transmitter ID random when battery gets inserted | ||
bool battery; // 1 if battery is low | ||
bool button; // true if was triggerd by tx transmit button | ||
byte channel; // channel switch of transmitter 1,2,3 | ||
int16_t temprature; // terperature in 1/10 °C | ||
int16_t humidity; // humidity in % | ||
unsigned long timestamp; | ||
}; | ||
|
||
WTDecoder() {}; | ||
~WTDecoder() {}; | ||
|
||
void Loop(); | ||
void Setup(); | ||
bool GetRecord(struct rec &record); | ||
|
||
private: | ||
bool decodeRecord(uint64_t value, struct rec &record); | ||
void printRecord(struct rec &record); | ||
}; | ||
|
||
#include <Arduino.h> | ||
|
||
#define WTD_DEBUG | ||
//#define WTD_DEBUG_VERBOSE | ||
//#define VALID_TX_ID_ONLY | ||
|
||
// WeMos D1 mini | ||
#define INT_PIN D2 // GPIO0 | ||
#ifdef WTD_DEBUG | ||
#define LED_PIN D4 // GPIO2 | ||
#endif | ||
|
||
#define MAX_CODES 20 | ||
#define MAX_RECORDS 20 | ||
|
||
class WTDecoder { | ||
public: | ||
struct rec | ||
{ | ||
bool valid; // record is valid | ||
byte txid; // transmitter ID random when battery gets inserted | ||
bool battery; // 1 if battery is low | ||
bool button; // true if was triggerd by tx transmit button | ||
byte channel; // channel switch of transmitter 1,2,3 | ||
int16_t temprature; // terperature in 1/10 °C | ||
int16_t humidity; // humidity in % | ||
unsigned long timestamp; | ||
}; | ||
|
||
WTDecoder() {}; | ||
~WTDecoder() {}; | ||
|
||
void Loop(); | ||
void Setup(); | ||
bool GetRecord(struct rec &record); | ||
|
||
private: | ||
bool decodeRecord(uint64_t value, struct rec &record); | ||
void printRecord(struct rec &record); | ||
}; | ||
|
||
extern WTDecoder wtd; |