Monday, June 11, 2018

Establishing a basic connection with the Wiimote

Establishing a basic connection with the Wiimote


Been working on coding for the Wiimote using C# and have thankfully made some progress. Import the wiimote library and create an object for the wiimote

using WiimoteLib;

Now in the main function
wm.Connect();
wm.SetReportType(InputReport.IRAccel, true);
wm.SetLEDs(true, false, false, false);

This establishes the connection with the wiimote and the SetLeds tells the wiimote to show the first of four lights on the controller.
x = wm.WiimoteState.IRState.IRSensors[0].Position.X.ToString();
y = wm.WiimoteState.IRState.IRSensors[0].Position.Y.ToString();

This saves the coordinates in our strings x and y. You can take a printout or do whatever you want with these values now, still not sure what rate the wiimote is streaming the data at though.

go to link download
download
alternative link download