using the EasyTransfer library

HI There
I have been having a pay with the EasyTransfer library between to of my uno, i have two 10k pots on the one which adjust to led brightness on the other uno all works fine :slight_smile:

Here are my sketches:
uno with two pots:

#include <EasyTransfer.h>
 
EasyTransfer ET;
 
struct DATA_STRUCTURE{
 int percentage;
 char temp;
};
 
DATA_STRUCTURE myData;
 
int val;
int val2;
 
void setup()
{
 //Initalizing EasyTransfer Serial Ports
 Serial.begin(9600);
 ET.begin(details(myData), &Serial);
 
//counter = 0;
}
 
void loop()
{
  val = analogRead(A0);            // reads the value of the potentiometer (value between 0 and 1023) 
  val = map(val, 0, 1023, 0, 250);     // scale it to use it with the servo (value between 0 and 180) 
  
  val2 = analogRead(A1);            // reads the value of the potentiometer (value between 0 and 1023) 
  val2 = map(val2, 0, 1023, 0, 250);     // scale it to use it with the servo (value between 0 and 180) 
  
 //Setting Values to Variables
 myData.temp       = val;
 myData.percentage = val2;
 
//Sending Data
 ET.sendData();
 delay(1000);
}

And the uno with the two LEDs:

#include <EasyTransfer.h>
 
EasyTransfer ET;
 
struct DATA_STRUCTURE{
 int percentage;
 char temp;
};
 
DATA_STRUCTURE myData;
 
void setup()
{ 
 Serial.begin(9600);
 ET.begin(details(myData), &Serial);
 pinMode(13, OUTPUT);
 pinMode(12, OUTPUT);
}
 
void loop()
{
 //Extract data if data is received
 if(ET.receiveData())
 {

 delay(250);
 analogWrite(12, myData.percentage); 
 analogWrite(13, myData.temp); 
 }
 
}

Now i would prefer to change the uno with the two LEDs for a Leonardo, up load my sketch and i can not get it to do anything :frowning:
why is this and how can i over come this?

Many thanks
Joe

How are the two Arduino connected? On the Uno, pins 0 and 1 are Serial. Not so on the Leonardo.

PaulS:
How are the two Arduino connected? On the Uno, pins 0 and 1 are Serial. Not so on the Leonardo.

pin 0 & 1 to pin 1 & 0

yer i was wondering if the Leonardo had serial pins with out using something like SoftwareSerial?

Pins 0 and 1 on the Leonardo are connected to the Serial1 instance.

i see now :slight_smile:

  Serial1.begin(9600);
 ET.begin(details(myData), &Serial1);

and now it is working :slight_smile:
thanks Pauls