Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Xbee+arduino communication problem

  1. Mar 20, 2014 #1
    I tried testing the system and I’m not sure if the problem is with the xbee’s, the transmitting code, or the recieveing code. Before I post my code I will explain what we are doing with the signals. We have three analog EMG signals that will be sent serially through on xbee using an arduino and xbee shield. We want to send these signals to the receiving xbee where the arduino will output these signals to be connected to a third arduino through wires to be used in a Simulink program. We are using an arduino mega for the transmitting side and an arduino uno for the receiving side. I was told I need to do serial streaming but I’m not sure how that’s done. I understand the xbee and arduinos both digitize signals but we are hoping to get a signal very similar to the analog signals we are transmitting. Any amount of help is greatly appreciated!!
    This is how I have my xbees configured (series 1) both in AT mode:
    Transmitting Xbee:
    Pan id: 1234
    MY: 10
    DL: 11
    Receiving Xbee:
    Pan ID: 1234
    MY: 11
    DL: 10
    transmitting Arduino code:
    void setup() {
    void loop() {
    // read the input on analog pins
    int sensorValue1 = analogRead(A0);
    int sensorValue2 = analogRead(A1);
    int sensorValue3 = analogRead(A2);
    // print out the value you read:
    Receiving Arduino code:
    int received1=8;
    int received2=9;
    int received3=10;
    void setup(){
    pinMode(received1, OUTPUT);
    pinMode(received2, OUTPUT);
    pinMode(received3, OUTPUT);
    void loop(){
    if(Serial.available() )
    byte output1 = Serial.read();
    byte output2 = Serial.read();
    byte output3 = Serial.read();
    digitalWrite(received1, HIGH);
    digitalWrite(received2, HIGH);
    digitalWrite(received3, HIGH);
  2. jcsd
  3. May 4, 2014 #2
    I'm sorry you are not finding help at the moment. Is there any additional information you can share with us?
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook