コード例 #1
0
ファイル: Program.cs プロジェクト: ewin66/TRapperProject
        //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();
        }
コード例 #2
0
 public void StartDataCollection()
 {
     m_Wiimotes.StartDataCollection("", false);
 }