コード例 #1
0
        public static void Main()
        {
            IMPU sensor = MPUSensor.GetInstance(SensorType.With6Axis);

            while (true)
            {
                ISensorData result = sensor.GetMeasurements();
                Debug.Print(result.ToString());

                Thread.Sleep(100);
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: Codexzier/Netduino.Sensors
        public static void Main()
        {
            IMPU sensor = MPUSensor.GetInstance(SensorType.With9Axis);

            while (true)
            {
                ISensorData result = sensor.GetMeasurements();
                Debug.Print(result.ToString());
                SensorData9Axis result9Axis = result as SensorData9Axis;
                if (result9Axis != null)
                {
                    Debug.Print("MagX:" + result9Axis.MagnometerX + ", MagY:" + result9Axis.MagnometerY + ", MagZ:" + result9Axis.MagnometerZ);
                }

                Thread.Sleep(100);
            }
        }