static void wiimote_Updated(object sender, EventArgs e) { IWiimote wiimote = (IWiimote)sender; if(wiimote.Extension is NunchukExtension) { NunchukExtension nunchuk = (NunchukExtension)wiimote.Extension; Console.Write("Buttons pushed down: {0} ", nunchuk.Buttons); Console.Write("Stick: X={0,5:0.00} Y={1,5:0.00} ", nunchuk.Stick.Calibrated.X, nunchuk.Stick.Calibrated.Y); Console.WriteLine("Accelerometer: X={0,5:0.00} Y={1,5:0.00} Z={2,5:0.00}", nunchuk.Accelerometer.Calibrated.X, nunchuk.Accelerometer.Calibrated.Y, nunchuk.Accelerometer.Calibrated.Z); } }
public NunchukInformation(NunchukExtension extension) { _Extension = extension; this.Build(); }