Пример #1
0
        private static void RangeResultEvent(Optoel.Optoel.Ble.BleSlave sender, Optoel.Optoel.Ble.BleSlave.RangeResultArgs e)
        {
            switch (e.Sensor)
            {
            case Optoel.Optoel.Sensor.Accel:
                Console.WriteLine(sender.SlaveNumber + ". Device Accel Range: " + e.Range.ToString());
                sender.GyroSetRange(Optoel.Optoel.GyroRange.GyroRange_1000s);

                break;

            case Optoel.Optoel.Sensor.Gyro:
                Console.WriteLine(sender.SlaveNumber + ". Device Gyro Range: " + e.Range.ToString());

                break;
            }
        }
Пример #2
0
        private static void SlaveRangeResultEvent(Optoel.Optoel.Ble.BleSlave.RangeResultArgs e)
        {
            switch (e.Sensor)
            {
            case Optoel.Optoel.Sensor.Accel:
                Console.WriteLine("Accel Range: " + e.Range.ToString());

                bleSlave.GyroSetRange(Optoel.Optoel.GyroRange.GyroRange_1000s);
                break;

            case Optoel.Optoel.Sensor.Gyro:
                Console.WriteLine("Gyro Range: " + e.Range.ToString());

                Console.WriteLine("\nPress any key to start.\n\n");
                string st = Console.ReadLine();

                Console.WriteLine("Accel Unit: mg \nGyro Unit:  degree/sec. \n");
                bleSlave.Start(Optoel.Optoel.Enable.Enable, Optoel.Optoel.Enable.Enable, Optoel.Optoel.Enable.Enable);
                timer.Enabled  = true;
                timer.Interval = 10000;
                timer.Start();
                break;
            }
        }