Here is the code I used for my BB-8. I will explain more in the near future, but I wanted to get up for everyone to check out. I have a total of 4 Arduinos running this system talking over XBEE. One in the controller, one in the Dome, one in Drive System and the last one running the sphere lighting. Tose last two have to be separate as one spins on the sphere and the other in stationary.
Arduino Codes for Download – BB8 Arduino
BB-Tx Controller STL Files – BB-TxControl
STEP BY STEP Controller Guide – Controller Guide
Parts for the BB-Tx Controller
Adafruit.com
Xbee x1 – https://www.adafruit.com/products/128
Xbee Adapter x1 – https://www.adafruit.com/products/126
Analog Stick Large x1 – https://www.adafruit.com/products/512
Analog Stick Small x2 – https://www.adafruit.com/products/444
Tac Switches – https://www.adafruit.com/products/1490
1200mah Lithium Battery – https://www.adafruit.com/products/258
Lithium Charger – https://www.adafruit.com/products/1904
Arduino Pro Mini 16mhz – https://www.adafruit.com/products/2378
FTDI Programmer – https://www.adafruit.com/products/284