Manchester Library (MCHR3k) RF Modules & Delays (Fixed, was Noise)

Hello everyone, I’m hoping to get some help on a problem I’ve been spinning my wheels on for a few days.

I’m new (again) to Arduino after starting a few years ago and losing interest. Now I’m learning and building at the same time - bad combo I suppose. I can’t believe my problem hasn’t been addressed somewhere - I just haven’t been able to come up with the right combo to find it I guess.

Setup: Arduino anything (I’ve tried a few different ones), cheap RF TX/RX pairs. The code below loops while sending 0-255 and then resetting to 0 again. Code below works great and is rock solid. But when I add a delay as I’ve //'ed out, all hell breaks loose. I’m looking to give it a second or two, but I receive nothing. If I bring it down to lets say delay(50) I can receive occasional transmissions but I’m getting skipping of the numbers. I can’t guess that it’s something interrupting the transmitter, it should be able to send with a delay if it’s OK at full speed as a simple loop.

I’ve also tried encoding the data. Nothing. I’ve also been looking for something like a TX Wait with no luck. Does anyone have any experience with this library and can offer any assistance? It’s located here: GitHub - mchr3k/arduino-libs-manchester

Thank you,
-John

#include <Manchester.h>
#define TX_PIN 1
#define SENDER_ID 5
uint8_t TX_DATA = 0;

void setup(){
  man.setupTransmit(TX_PIN, MAN_1200);
}

void loop(){
  man.transmit(man.encodeMessage(SENDER_ID, TX_DATA));
  TX_DATA++;
// delay(1000);
}

Use the Virtualwire library instead of Manchester. http://www.pjrc.com/teensy/td_libs_VirtualWire.html

Milleker: ```

define TX_PIN 1

I don't think you want to be using the UART TX pin for this. The MCHR3k code uses its own timing, and the signalling isn't compatible with standard serial. Does the code work if you use the suggested pin 5?

You don't need to do additional encoding. This library sends the preamble to set the receiver's AGC correctly, masks the data to avoid zero bytes at the end of the transmission confusing the library, Manchester encodes the bit stream, and sends the correct stop bits.