Go Down

Topic: Wiimote Robotic Control (Read 408 times) previous topic - next topic

fronzbot

Jul 03, 2011, 10:45 pm Last Edit: Jul 03, 2011, 11:39 pm by fronzbot Reason: 1
Hey guys, part of a robotics project I decided to tackle for one of my classes is to control a robot (specifically a quadrocopter) using a Wiimote.  Initially I read over the Wiibrew wiki for the wiimote [link] and it seemed quite feasible so in a bit of haste I decided to buy the SparkFun Bluetooth Mate Silver.  I've been trying to just test it to make sure it's working and I ran into a few problems:

  • I cannot view Serial output via the Serial Monitor (though using some LEDs I can see SOMETHING is happening)

  • I'm not entirely sure I can even connect to the Wiimote using this method



For the first problem- are there any good workarounds where I can view the serial output as well as send data via serial? It seems I can only do one or the other.  the SoftwareSerial library would be an option if it didn't have baud rate limite of 9600 (the bluetooth module runs at 115200).  

For the second problem- well, it really says it all.  Can I even connect the wiimote to my arduino using the Bluetooth Mate as an intermediary?  My second option (one that seems like less of a nightmare to program but more of an expense) is to send the Wiimote info through a PC and then back out to the Arduino via bluetooth.  I'd prefer to solve it without the use of a PC but if it is absolutely necessary I can concede on that point.

If ANYONE can help, offer more reading material, ANYTHING, I'd be extremely grateful!

And for reference, my current code:

Code: [Select]
#include <avr/io.h>
//Wii Address = 00:1B:7A:3E:97:45

void setup()
{
 // put your setup code here, to run once:
 pinMode(31,OUTPUT);
 Serial1.begin(115200);   // opens serial port, sets data rate to 9600 bps
 Serial1.flush();
 //enter command mode
 digitalWrite(31,HIGH);
 Serial1.write('$$$');             // CMD mode
 delay(100);
 Serial1.write('SA,1');            // Require BT Authentication
 delay(100);
 Serial1.write('SR,001B7A3E9745'); // Store Remote BT address
 delay(100);
 Serial1.write('C');               // Attempts to connect to remote address
}

void loop()
{

}

Go Up