The code I'm using is essentially the same as the library examples with a few modifications. It turns an led on the Rx on for a second and then off for a second.
Tx
#include <MANCHESTER.h>
#define TxPin 4 //the digital pin to use to transmit data
unsigned int ON = 1010; //the 16 bits to send
unsigned int OFF = 0000; //the 16 bits to send
void setup()
{
MANCHESTER.SetTxPin(TxPin); // sets the digital pin as output default 4
}
void loop()
{
MANCHESTER.Transmit(ON);
delay(1000);
MANCHESTER.Transmit(OFF);
delay(1000);
}
Rx
#include <MANCHESTER.h>
#define RxPin 4
#define ledPin 0
void setup()
{
pinMode(ledPin, OUTPUT);
MANCHESTER.SetRxPin(RxPin); //user sets rx pin default 4
MANCHESTER.SetTimeOut(1000); //user sets timeout default blocks
}
void loop()
{
unsigned int data = MANCHESTER.Receive();
if (data == 1010)
{
digitalWrite(0, HIGH);
}
else
{
digitalWrite(0, LOW);
}
}