Go Down

Topic: Changing the value of a variable wirelessly via Xbees (Read 299 times) previous topic - next topic

MarcRyan

All I need to do is change a float in my program through the xbee. I'm trying to use the Serial.read function, but don't really know if there's an easier way.

Ultimately, what I want to be able to do, is open up Putty, type "1.5" or "2.4" and change a variable in my program to that value.  How can I do this?

Marc

PaulS

Quote
I'm trying to use the Serial.read function, but don't really know if there's an easier way.

Easier than what? Using the proper method?

You could ignore the XBee and just generate a random number. That would be easier.

MarcRyan


I'm new to both the arduino and xbee world, so I don't know what the "proper" method is. I apologize if any part of my post was unclear.

Anyway, short of generating a random number, and putting in a value that would actually be useful, what functions/commands/etc would be required?

PaulS

The proper methods are available(), to see if there is anything to read, and read() to read it, if there is.

However, what class those methods belong to depends on how the XBee is connected to the Arduino. Which instance of the class to call those methods on depends on what code is on the Arduino.

Go Up