We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello, I'm a student and i make a project. In this project we have many sensor like tilt sensor, Co2 sensor, camera and we need to connect this component who are in a robot, to a computer for see the information send by the robot. We have two XBee pro, we try to send information but we don't understand how to see the information on Processing, Actually we see the information in XCTU.
Thanks for your help.
Answers
Hi, Sokky,
You will need to create a serial connection between Processing and one of the XBee modules. Here is an example that uses an XBee 802.15.4 module connected to a PC running Processing, to communicate with another XBee module connected to an Arduino controller. There is a potentiometer connected to analog pin 0 on the Arduino, and the Processing sketch prints the value of the pin as transmitted via the XBee radios.
[By default the Arduino sends character data, so e.g. if the potVal is 10, the Arduino will transmit char(49), char(48), char(13), char(10), i.e. '1', '0', carriage return, line feed. So, the Processing sketch uses the readStringUntil method to read up to the line feed (10).]
Corresponding Arduino code (just for illustration):
If you have multiple sensors, then you will also need to determine a scheme for parsing the data. I suggest looking online for Tom Igoe's examples or check out the book Making Things Talk.
Hope this helps. Good luck!