Okay, let me start by saying I just started working with these modules that were given to me by a friend. I have two Xbees, an Xbee shield v1.2 and a USB Xbee adapter. So I have connected the USB adapter with an Xbee to my PC, confirmed it shows up and usb/serial port com14. I then loaded a sketch provided by Seeed on the arduino, see below.
/*
Example from Arduino SoftwareSerial tutorial
*/
#include <SoftwareSerial.h>
SoftwareSerial mySerial(11, 12); // RX, TX
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
mySerial.begin(9600);
}
void loop() // run over and over
{
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
}
So what this all does is I open the serial connection to the bee plugged into my computer and with the arduino connected via USB I opened a serial monitor in the IDE.
When I type something in the putty window, it shows up in the serial monitor of the Arduino. Pretty cool really.
So what I want to do ultimately is connect some sensors to my arduino and send a string from my computer that tells the arduino I want sensor data. It doesn't have to be streaming data, just the numbers from the sensors at the moment I asked for them. So when the arduino receives the "Send me data" string, it sends back the data. Basically a wireless weather station. But I don't want the arduino to transmit data unless I ask for it. Does this make sense?
I'm going to start out with a photoresistor just to return some arbitrary numbers that I can see changing.
Thanks in advance everybody.