Pages: [1]   Go Down
Author Topic: Changing the value of a variable wirelessly via Xbees  (Read 288 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 640
Posts: 50331
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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?
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 640
Posts: 50331
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: