Hello everyone ,
I would like to have information about a project I am about to do for studies .
I would like to connect two XBee Series 1 between them but I can not do it , I downloaded the XBee library but then I came not to connect and find a fairly simple program just to be able to connect and lit lamp using a XBee that it will light the lamp on the other Arduino that I have with my second XBee .
Can you help me ?
greetings
Start by getting your project working between the arduinos without the xbees (use wire between the tx/rx/gnd). When that is working then replace the wires with the xbees.
can you give me the program with the son connected on the TX / RX / GND outputs ?
kind regards
Below is some serial test code you can try.
//zoomkat 3-5-12 simple delimited ',' string tx/rx
//from serial port input (via serial monitor)
//and print result out serial port
//Connect the sending arduino rx pin to the receiving arduino rx pin.
//Connect the arduino grounds together.
//What is sent to the tx arduino is received on the rx arduino.
//Open serial monitor on both arduinos to test
String readString;
void setup() {
Serial.begin(9600);
Serial.println("serial delimit test 1.0"); // so I can keep track of what is loaded
}
void loop() {
//expect a string like wer,qwe rty,123 456,hyre kjhg,
//or like hello world,who are you?,bye!,
if (Serial.available()) {
char c = Serial.read(); //gets one byte from serial buffer
if (c == ',') {
if (readString.length() >0) {
Serial.print(readString); //prints string to serial port out
Serial.println(','); //prints delimiting ","
//do stuff with the captured readString
readString=""; //clears variable for new input
}
}
else {
readString += c; //makes the string readString
}
}
}
I tried your program it works fine except that my worries is that I'd like to connect two Arduino on a single computer. Now I'd like to with two XBee I can connect them in the program and I love that one sends data that allows the LED lights on the other Arduino (the XBee reception)
Can you give me the two programs (that of the reception and that of sending)?
Thank you for all you do for me. It helps me a lot because I do not have much experience in this field and I have to do a business project.
Have a nice day zoomkat