Beispiel #1
0
        //public static void Test3SpaceSensorAccGyro()
        //{
        //    SpaceSensorMain spaceSensorMain = new SpaceSensorMain();
        //    spaceSensorMain.SpaceSensorObject1.Connect();

        //    CSVFileWriter csvFileWriter = new CSVFileWriter(@"D:\temp\TestData.csv");

        //    for (int i = 0; i < 50; i++)
        //    {
        //        SensorData sensorDataObj = spaceSensorMain.SpaceSensorObject1.ReadAccGyroData();
        //        //Quaternion sensor2QuatObj = _spaceSensorMain.SpaceSensorObject2.ReadOrientation();
        //        StringBuilder dataRow = new StringBuilder();

        //        dataRow.Append(String.Format("{0:hh:mm:ss.fff}", DateTime.Now));
        //        dataRow.Append("," + sensorDataObj.AccDataObject.DataVector.X);
        //        dataRow.Append("," + sensorDataObj.AccDataObject.DataVector.Y);
        //        dataRow.Append("," + sensorDataObj.AccDataObject.DataVector.Z);
        //        dataRow.Append("," + sensorDataObj.GyroDataObject.Pitch);
        //        dataRow.Append("," + sensorDataObj.GyroDataObject.Roll);
        //        dataRow.Append("," + sensorDataObj.GyroDataObject.Yaw);

        //        csvFileWriter.writeLine(dataRow.ToString());
        //        Thread.Sleep(100);

        //    }

        //    csvFileWriter.close();
        //}

        public static void Test3SpaceSensor()
        {
            Wiimotes wiimotesObj = Wiimotes.getWiimotesObject();

            wiimotesObj.connectWiimotes(1);
            wiimotesObj.StartDataCollection(@"D:\temp\TestData.csv", true);
            Thread.Sleep(30000);
            wiimotesObj.StopDataCollection();
            Thread.Sleep(3000);
            wiimotesObj.disconnectWiimotes();
            Application.Exit();
        }
        public bool connectWiimotes()
        {
            try
            {
                this.m_parent.SetWiimoteButtonState((object)Form1.WiimoteButtonState.CONNECTED);
                this.m_parent.SetTextWiimoteStatus(WIIMOTES_CONNECTING_STRING);
                this.m_parent.Update();


                this.m_parent.wiimoteConnectionProgress.Maximum = Configuration.getConfiguration().MaxWiimoteConnectionTries;

                m_Wiimotes.connectWiimotes(Configuration.getConfiguration().MaxWiimoteConnectionTries);
                handleWiimoteConnected();
                return(true);
            }
            catch (WiimoteConnectionException ex)
            {
                handleWiimoteConnectError(ex.State);
                Console.WriteLine(ex);
                return(false);
            }
        }
Beispiel #3
0
 private void connectWiimotes()
 {
     mWiimotes.connectWiimotes();
 }