We’ve hacked together a C# program in Visual Studio 2005 that writes motor commands like #+20-15; (motor 1 200 forward, motor 2 150 reverse). The serial port has Xbee connected to it. The only tricky part was the motor equations below.
double radians = Math.Atan2(dy, dx);radians = radians + Math.PI / 2;
m1 = (int)(Math.Abs(dx) * Math.Sin(radians) + Math.Abs(dy) * Math.Cos(radians));
m2 = (int)(Math.Abs(dy) * Math.Cos(radians) – Math.Abs(dx) * Math.Sin(radians));
(Equations from David “Wild Shot”)
Eventually we abandon the idea of control with a PC and created our own remote control with a second Arduino Duemilanove, XBee shield, XBee and Wii nunchuck. Thanks to ThingM (http://thingm.com/
and fungizmos.com (http://store.fungizmos.com/
) getting the Wii nunchuck was easier to get working then getting the old-school PC joystick that we tried too.