Example #1
0
        // Accel Data Event
        private static void AccelDataEvent(Optoel.Optoel.BMX055.Accel Accel)
        {
            accelcsv = Accel;
            Console.WriteLine("Accel:   {0},    {1},    {2}", Accel.RawX, Accel.RawY, Accel.RawZ);

            swAccel.WriteLine(Accel.AccelDataNumber.ToString(new CultureInfo("en-US", false)) + ", " + Accel.RawX.ToString(new CultureInfo("en-US", false)) + "," + Accel.RawY.ToString(new CultureInfo("en-US", false)) + "," + Accel.RawZ.ToString(new CultureInfo("en-US", false)));
            swAccel.Flush();
        }
Example #2
0
        private static void AccelDataEvent(Optoel.Optoel.Ble.BleSlave sender, Optoel.Optoel.BMX055.Accel Accel)
        {
            accelcsv = Accel;
            Console.WriteLine(sender.SlaveNumber + ". Device Accel:   {0},    {1},    {2}", Accel.RawX, Accel.RawY, Accel.RawZ);

            if (sender.SlaveNumber == 1)
            {
                swAccel1.WriteLine(Accel.AccelDataNumber.ToString(new CultureInfo("en-US", false)) + ", " + Accel.RawX.ToString(new CultureInfo("en-US", false)) + "," + Accel.RawY.ToString(new CultureInfo("en-US", false)) + "," + Accel.RawZ.ToString(new CultureInfo("en-US", false)));
                swAccel1.Flush();
            }
            else if (sender.SlaveNumber == 2)
            {
                swAccel2.WriteLine(Accel.AccelDataNumber.ToString(new CultureInfo("en-US", false)) + ", " + Accel.RawX.ToString(new CultureInfo("en-US", false)) + "," + Accel.RawY.ToString(new CultureInfo("en-US", false)) + "," + Accel.RawZ.ToString(new CultureInfo("en-US", false)));
                swAccel2.Flush();
            }
        }