Beispiel #1
0
        private static void inputClient_DataReceived(IAsyncResult result)
        {
            var bytesReceived = client.Client.EndReceive(result);

            if (bytesReceived > 0)
            {
                Console.WriteLine("Disconnecting");
                Wiimotes.DisconnectAll();
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Wiimotes.ButtonClicked += Button;
            int numConnnected = Wiimotes.Connect(5);

            if (numConnnected > 0)
            {
                Console.WriteLine("{0} wiimote(s) found", numConnnected);
                Console.WriteLine("Press ENTER to quit");
                Console.ReadLine();
                Wiimotes.DisconnectAll();
            }
            else
            {
                Console.WriteLine("No Wiimotes found");
            }
        }