Register to reply

Xbee+arduino communication problem

by ReneeL
Tags: arduino, xbee
Share this thread:
ReneeL
#1
Mar20-14, 12:01 AM
P: 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:
Channel:10
Pan id: 1234
MY: 10
DL: 11
Receiving Xbee:
Channel:10
Pan ID: 1234
MY: 11
DL: 10
transmitting Arduino code:
void setup() {
Serial.begin(9600);
}
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:
Serial.println(sensorValue1);
Serial.println(sensorValue2);
Serial.println(sensorValue3);
delay(1);
}
Receiving Arduino code:
int received1=8;
int received2=9;
int received3=10;
void setup(){
pinMode(received1, OUTPUT);
pinMode(received2, OUTPUT);
pinMode(received3, OUTPUT);
Serial.begin(9600);
}
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);
}
}
Phys.Org News Partner Science news on Phys.org
Fungus deadly to AIDS patients found to grow on trees
Canola genome sequence reveals evolutionary 'love triangle'
Scientists uncover clues to role of magnetism in iron-based superconductors
Greg Bernhardt
#2
May4-14, 10:06 PM
Admin
Greg Bernhardt's Avatar
P: 9,490
I'm sorry you are not finding help at the moment. Is there any additional information you can share with us?


Register to reply

Related Discussions
Neutrino Communication Problem Advanced Physics Homework 16
Serial Communication btwn Matlab and Arduino Math & Science Software 2
XBee Communication For Flying Device Electrical Engineering 0
Wireless Communication Problem involving Summation of 2 antenna's signals Engineering, Comp Sci, & Technology Homework 0
Need help with communication system problem Electrical Engineering 0