We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Arduino -> XBee -> Processing (Help needed)
Page Index Toggle Pages: 1
Arduino -> XBee -> Processing (Help needed) (Read 431 times)
Arduino -> XBee -> Processing (Help needed)
Feb 16th, 2009, 11:08am
 
Not sure  if this is the correct place to post this, but here goes.

Basically I have a temp sensor attached to Analgue input 0 of an arduino board. I was reading the data into processing using:

import processing.serial.*;
import cc.arduino.*;

Arduino arduino;
int sensorPin = 0;    // Analog input pin
int sensorValue = 0;  // value read from the sensor
void setup()
{
//println(Arduino.list());
arduino = new Arduino(this, Arduino.list()[1]); // v2
// arduino = new Arduino(this, Arduino.list()[0], 9600); // v1
 arduino.pinMode(sensorPin, Arduino.INPUT);
}

void draw()
{
 sensorValue = arduino.analogRead(sensorPin); // read the sensor value
 
 println(sensorValue);  // print the sensor value
 delay(5000);    // wait 10 milliseconds
                 // before the next loop
}

This part is working fine.

I now want make the connection between the arduino and PC wirless using XBee.

The set up being temp sensor output goes into Analogue in 0 of arduino. The Tx & Rx pins of the arduino are connected to sending Xbee module. Receiving XBee module is connected to PC via USB -> serial adaptor.

I have set the XBee modules up so there is no need to do it within the program and have tested it within arduino alone (reading values into arduinos serial monitor, with a different arduino program)

How do I adapt the processing program above to use XBee?
Page Index Toggle Pages: 1