I have used easytransfer before with simplex cheapy modules with no trouble.
I am trying to send data at 9600 from the Txd pin of one Atmega 328, to the Rxd of another.
The rf modules are tranceivers in simple mode, the wavefore at the RX end ( green) is delayed a bit from the Tx,( red ) but looks the same as the Tx.
The waveform is actually measured on the RXd pin of the chip. The LED just stays on , any ideas where I am going wrong, I have been battling with trying to get a serial link going for a week now. the code is below
( I had to shift the green one to the left as the modules have a fifo buffer that delaysTx abit )
I have loaded the example from the Github ie the TX:-
#include <EasyTransfer.h>
EasyTransfer ET;
struct SEND_DATA_STRUCTURE{
//put your variable definitions here for the data you want to send
//THIS MUST BE EXACTLY THE SAME ON THE OTHER ARDUINO
int blinks;
int pause;
};
//give a name to the group of data
SEND_DATA_STRUCTURE mydata;
void setup(){
Serial.begin(9600);
//start the library, pass in the data details and the name of the serial port. Can be Serial, Serial1, Serial2, etc.
ET.begin(details(mydata), &Serial);
pinMode(13, OUTPUT);
randomSeed(analogRead(0));
}
void loop(){
//this is how you access the variables. [name of the group].[variable name]
mydata.blinks = random(5);
mydata.pause = random(5);
//send the data
ET.sendData();
//Just for fun, we will blink it out too
for(int i = mydata.blinks; i>0; i--){
digitalWrite(13, HIGH);
delay(mydata.pause * 100);
digitalWrite(13, LOW);
delay(mydata.pause * 100);
}
delay(2000);
}
and the receive ( with different pin for the LED ) :-
#include <EasyTransfer.h>
//create object
EasyTransfer ET;
int ledPin = 10;
struct RECEIVE_DATA_STRUCTURE{
//put your variable definitions here for the data you want to receive
//THIS MUST BE EXACTLY THE SAME ON THE OTHER ARDUINO
int blinks;
int pause;
};
//give a name to the group of data
RECEIVE_DATA_STRUCTURE mydata;
void setup(){
Serial.begin(9600);
//start the library, pass in the data details and the name of the serial port. Can be Serial, Serial1, Serial2, etc.
ET.begin(details(mydata), &Serial);
pinMode(ledPin, OUTPUT);
}
void loop(){
//check and see if a data packet has come in.
if(ET.receiveData()){
//this is how you access the variables. [name of the group].[variable name]
//since we have data, we will blink it out.
for(int i = mydata.blinks; i>0; i--){
digitalWrite(ledPin, HIGH);
delay(mydata.pause * 100);
digitalWrite(ledPin, LOW);
delay(mydata.pause * 100);
}
}
//you should make this delay shorter then your transmit delay or else messages could be lost
delay(250);
}