Arduino & xbee tutorial - transmit from seperate arduino wirelessly to pc or mac

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
20,622
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Nov 15, 2009

Something i found difficult to begin with, as there were not that many tutorials.
This is a quick example including code to get an arduino with xbee shield, talking to a separate arduino - atmel board, connected to usb.

I use a potentiometer as a way of verifying the code is working and that it is correctly transmitting.

sorry about the audio - i took this with my g2

this is the code without the extra bits not needed in the tutorial (shortened)

int ledPin = 0; // select the pin for the analog port 0
int val = 0; // variable to store value coming from sensor

void setup() {
Serial.begin(2400);
}
void loop() {
val = analogRead(ledPin); // read value from sensor

sendValue (val);
delay(100); // stop the program for some time
}
void sendValue (int val){ //new function
Serial.print(val); //print value to xbee (serial port)
Serial.print(" "); //print a space so we can see
}

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 3 dislikes

Link to this comment:

Share to:

Uploader Comments (roboteernat)

  • Hey...this is a super nice video...I am noob to arduino and wanted to build something like this. But I want to control 2 separate servos with 2 separate pots wireless. Wht do I need to buy as far as a basic setup? Any information would be helpful. Thanks

    Charles

  • @cbizzyr Can i ask, is it 2 servos and pots seperate from each other, ie 4 clusters of parts? or is it just to have 2 sevos on one xbee and 2 pots on another xbee?

  • how do you wire it without a shield?

  • @inspiredStudent sorry for not replying sooner, the basic connections would be power to the xbee and connecting the transmit and recieve pin together, i will respond with another vdeo in next few days.

  • thank you!! but what do you do if you want to send more than one analog value? what's the code like?

  • @mcgyverbrown thanks, to send more than one analogue value in this example, you would just need to insert a readadc command, and then add the second memory name in the send value subroutine

    int ledpin2 = 0;

    int val2 = 0;

    val2 = analogRead(ledPin2); // read value from sensor

    void sendValue (int val, val2){ //new function

    Serial.print(val); //print value to xbee (serial port)

    Serial.print(val2);

    as example additional lines

see all

All Comments (13)

Sign In or Sign Up now to post a comment!
  • @roboteernat Hey thanks for the reply... What I am basically tryin to do is replace my RC trans./receiver for a arduino setup. So I need to pans to control speed and steering connected to a transmitter type device, Im guessing a Xbee and Arduino/Nano?, then I need a reciever(Xbee+Arduino?) thats hooked up to the 2 servos. Let me know your thoughts. Thanks

    Charles

  • wich program did you use to setup xbee with mac?

  • @bluemagictube

    thanks! let me know how your project goes. If you need any help, let me know.

    Nat

  • It is awesome that you took the time to do this thank you! I am working on something similar and will post the tutorial as well .

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more