Goal: To get my DFRobotShop Rover to talk over xbee and be controlled via an Analog Joystick.
Parts:
The Rover from DFRobotShop $90 (My prize from this Instructable!)
Joystick Shield from Sparkfun $13
ProtoShield from AdaFruit $13
Xbee and Adapter MakerShed $35 (you'll need 2 of these)
Halfsize Breadboard Adafruit $5
Arduino Uno from Adafruit $30
FTDI interface IteadStudio $9 (FTDI cable, or de-chipped arduino also work)
Tools:
Solder iron
Jumper wires
USB cables of all sorts
Aleve, Lots of Aleve
Links:
http://www.ladyada.net/make/xbee/index.html (AdaFruit Tutorial)
http://www.digi.com/support/kbase/kbaseresultdetl.jsp?kb=125 (XTCU Software)
http://www.sparkfun.com/tutorials/171#setup (Joystick Turorial)
http://www.robotshop.com/content/PDF/dfrobotshop-rover-user-guide.pdf (Rover Manual)
Remove these ads by
Signing UpStep 1: Wiring
Assemble Rover as per Robotshop instructions. Same with the Joystick and Xbee shields. Place protoshield on the rover and Xbee adapter on top. Start connecting wires.
Xbee RX⇒TX on the Rover
Xbee TX⇒RX on the Rover
5volts to 5Volts and Gnd to Gnd
Joystick Shield:
Arduino TX⇒RX Xbee
Arduino RX⇒TX Xbee
5volt to 5volt and Ground to Ground
And that's it.







































Visit Our Store »
Go Pro Today »




http://www.seeedstudio.com/depot/4wd-arduino-robot-platform-global-free-shipping-p-658.html?cPath=170_172
I have an Arduino Uno with the joystick shield and an Arduino duemilanove and Adafruit Motor Shield to run the Motors, the motor shield is powered separately from the Arduino so there is no Brownout occurring, I have tried your code as it incorporates two motors and i thought it would work but have had no success, your code compiles ok on both the joystick and rover end but i get no movement from the bot at all....
Any help would be amazing,
Cheers
Laurence
http://www.ladyada.net/make/mshield/faq.html The pins that the H-bridge is attached to on the Motorshield are different that this rover. Adafruits board uses Digital pin 4, 7, 8 and 12. You could still use the joystick code if you match it up to
serial out the information that will make the motorshield turn the motors on, ie Digital write pin 9 high(forward).
I would use some of LadyAda's code. and the library AF_motor. It will make what you are doing alot easier. The forums on Adafruit can be very useful. I have a motor shield
You basically want the joystick arduino to serial write a command that mean go (forward) and if you connect if RX and TX together, the two arduinos will talk to each other.
Good luck and please message me if you post an instructable of your build. I'd love to see what you're making.
I am fairly new to Xbee, not sure how to modify the code correctly as i have tried numerous different attempts and have had all fail. I can talk to the xbee's, i have proven that to myself, and i have got the motor shield running, only thing is getting it all to work with the joystick shield and Xbee, Your code allows me to view the serial data in the serial monitor so a good sign, Please if you could help me compile the code i would be most appreciative, i am a cognitive learner so i struggle with written explanations, hence why instructable's is for me,
I would most definitely post it as a full Instructable, link your page in, it would help so many people as i know a lot of people are struggling with my same kit, and it would really open doors for people learning xbee and Robot Platform 4WD control,
Again thank you for the reply i am continuing on for now,
regards
int E1 = 4; //M1 Speed Control
int E2 = 7; //M2 Speed Control
int M1 = 8; //M1 Direction Control //this is where you change the pins
int M2 = 12; //M2 Direction Control
int LED = 13; void setup
(void) { int i; for(i=5;i<=8;i++) //this "for" loop here initializes the pins. change pinMode(i, OUTPUT); //to pinMode(4, OUTPUT); pinMode(7,OUTPUT)
pinMode(13, OUTPUT); //et cetera
Serial.begin(9600);
the trouble with doing it this way is that I just don't know if the motor shield will work this way. I've only tried the motor shield with the AF_motor library.
http://www.robotshop.com/dfrobotshop-rover-tracked-robot-xbee-kit-8.html
And using a joystick shield with Xbee and your code it should work, and once i know i have it all working exactly like your instructable i will attempt the cross over between projects, but in the meantime i have had an idea and found a way to control my 4WD using the DAGU Wild Thumper, it allows me to plug an 2.4GHz RC receiver directly into it and use a 2.4 GHz transmitter to control it, it has a sketch already uploaded which allows it to do so, hopefully it all works. One thing i have learned is that there are many many ways to make and control a RC 4WD bot, the only thing is the expense of the DAGU controller, almost 3 times that of an arduino and Motor controller bought separately, so i guess you pay for convenience.
Cheers for your response, as soon as i get my Xbee's working again i will try this quick code fix out and get back to you.
Any help is greatly appreciated,
Thanks!