I am using the code below in the attempt to get Data via 433MHz from an ATtiny85. I can see the data being transmitted on the scope attached to the receiver side. There is a lot of noise before and after the data, most probably created by auto gain control in the receiver module.
Unfortunately, I never get a receiveComplete() as true for some unknown reason:
#include <Manchester.h>
#define ALERT 13
#define DATA_433 4
uint16_t packet;
uint16_t last_packet;
void setup() {
pinMode(ALERT, OUTPUT);
digitalWrite(ALERT, LOW);
man.setupReceive(DATA_433, MAN_1200);
man.beginReceiveArray(2, (uint8_t *)&packet);
last_packet = 0x2f3a;
Serial.begin(9600);
Serial.println("");
}
void loop() {
Serial.println(packet, HEX); // #1 - see below
if (man.receiveComplete())
{
Serial.println(packet, HEX); // #2 - see below
if(packet!=last_packet)
{
if(packet&0x4000) digitalWrite(ALERT, HIGH);
last_packet = packet;
}
man.beginReceiveArray(2, (uint8_t *)&packet);
}
}
The first Serial.println() (marked #1) in the loop bravely prints out the received packet, whereas #2 never prints anything at all. So it looks like receiveComplete() never is true.
What am I missing here?
Receiver is an Arduino Nano, if that matters.