Skip to content

Commit

Permalink
Rename WTDecoder.h to Funkthermometer/WTDecoder.h
Browse files Browse the repository at this point in the history
  • Loading branch information
DonKracho authored Sep 21, 2018
1 parent cf7eacd commit e333f53
Showing 1 changed file with 41 additions and 41 deletions.
82 changes: 41 additions & 41 deletions WTDecoder.h → Funkthermometer/WTDecoder.h
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;

0 comments on commit e333f53

Please sign in to comment.