29 lines
595 B
C++
29 lines
595 B
C++
#ifndef RF433_H
|
|
#define RF433_H
|
|
|
|
#include<util/delay.h>
|
|
#include"writepin.h"
|
|
|
|
#define LARGE_TIME 750
|
|
#define SMALL_TIME 250
|
|
|
|
class WirelessRelay
|
|
{
|
|
private:
|
|
uint16_t _id;
|
|
volatile unsigned char *_port;
|
|
unsigned char _pin;
|
|
void sendBit( const bool i);
|
|
void sync();
|
|
void sendId();
|
|
|
|
public:
|
|
WirelessRelay( volatile unsigned char *port, const unsigned char pin, const uint16_t id);
|
|
WirelessRelay();
|
|
void init( volatile unsigned char *port, const unsigned char pin, const uint16_t id);
|
|
void on();
|
|
void off();
|
|
uint16_t getId();
|
|
};
|
|
#endif
|