Hi, im using an arduino mega and i want to pass a value i get from an accelerometer to another arduino mega, what i did was to configure my xbee using x ctu, the first one i put the option of coordinatorAPI and the Pan ID 08 in the other xbee i put the option of End Device API and the same Pan ID 08 the both have the same baud rate in 9600 on the first one i used this code
void setup() //
{
Serial.begin(baud_rate); //
Serial3.begin(baud_rate);
}
...
void loop()
{
cambio=0;
TomaValores();
cambio = CambioDir();
if(cambio==1)
{
numero=ValorSale();
Serial.print(numero);
Serial.print("num q sale\n");
EnviaValor(numero);
}
...
void EnviaValor(int numero)
{
Serial3.print(numero);
Serial3.print(" ");
}
and finally in the other arduino i put this code
void setup()
{
Serial.begin(9600);
Serial1.begin(9600);
}
void loop()
{
if(Serial1.available()>0)
{
a=Serial1.read();
Serial.print(a);
Serial.print("Recibi:");
Serial.print("\n");
}
am i doing something wrong??