private static void GyroDataEvent(Optoel.Optoel.Ble.BleSlave sender, Optoel.Optoel.BMX055.Gyro Gyro) { gyrocsv = Gyro; Console.WriteLine(sender.SlaveNumber + ". Device Gyro: {0}, {1}, {2}", Gyro.RawX, Gyro.RawY, Gyro.RawZ); if (sender.SlaveNumber == 1) { swGyro1.WriteLine(Gyro.GyroDataNumber.ToString(new CultureInfo("en-US", false)) + ", " + Gyro.RawX.ToString(new CultureInfo("en-US", false)) + "," + Gyro.RawY.ToString(new CultureInfo("en-US", false)) + "," + Gyro.RawZ.ToString(new CultureInfo("en-US", false))); swGyro1.Flush(); } else if (sender.SlaveNumber == 2) { swGyro2.WriteLine(Gyro.GyroDataNumber.ToString(new CultureInfo("en-US", false)) + ", " + Gyro.RawX.ToString(new CultureInfo("en-US", false)) + "," + Gyro.RawY.ToString(new CultureInfo("en-US", false)) + "," + Gyro.RawZ.ToString(new CultureInfo("en-US", false))); swGyro2.Flush(); } //swAllData.WriteLine( // accelcsv.RawX.ToString(new CultureInfo("en-US", false)) + "," + // accelcsv.RawY.ToString(new CultureInfo("en-US", false)) + "," + // accelcsv.RawZ.ToString(new CultureInfo("en-US", false)) + "," + // gyrocsv.RawX.ToString(new CultureInfo("en-US", false)) + "," + // gyrocsv.RawY.ToString(new CultureInfo("en-US", false)) + "," + // gyrocsv.RawZ.ToString(new CultureInfo("en-US", false)) + "," + // magnocsv.RawX.ToString(new CultureInfo("en-US", false)) + "," + // magnocsv.RawY.ToString(new CultureInfo("en-US", false)) + "," + // magnocsv.RawZ.ToString(new CultureInfo("en-US", false)) + "," // ); //swAllData.Flush(); }
// Gyro Data Event private static void GyroDataEvent(Optoel.Optoel.BMX055.Gyro Gyro) { gyrocsv = Gyro; Console.WriteLine("Gyro: {0}, {1}, {2}", Gyro.RawX, Gyro.RawY, Gyro.RawZ); swGyro.WriteLine(Gyro.GyroDataNumber.ToString(new CultureInfo("en-US", false)) + ", " + Gyro.RawX.ToString(new CultureInfo("en-US", false)) + "," + Gyro.RawY.ToString(new CultureInfo("en-US", false)) + "," + Gyro.RawZ.ToString(new CultureInfo("en-US", false))); swGyro.Flush(); swAllData.WriteLine( accelcsv.RawX.ToString(new CultureInfo("en-US", false)) + "," + accelcsv.RawY.ToString(new CultureInfo("en-US", false)) + "," + accelcsv.RawZ.ToString(new CultureInfo("en-US", false)) + "," + gyrocsv.RawX.ToString(new CultureInfo("en-US", false)) + "," + gyrocsv.RawY.ToString(new CultureInfo("en-US", false)) + "," + gyrocsv.RawZ.ToString(new CultureInfo("en-US", false)) + "," + magnocsv.RawX.ToString(new CultureInfo("en-US", false)) + "," + magnocsv.RawY.ToString(new CultureInfo("en-US", false)) + "," + magnocsv.RawZ.ToString(new CultureInfo("en-US", false)) + "," ); swAllData.Flush(); }