예제 #1
0
        //## Magnetometer
        async Task ReadMagnetometer()
        {
            byte[] rawData = await BLE_Utilities.ReadData(Sensor.Accelerometer);

            float[] vals = SensorConvert.convertAccelerometer(rawData);
            await this.Dispatcher.BeginInvoke((Action)(() => setMagnetometer(vals[0], vals[1], vals[2])));
        }
예제 #2
0
 async void NotifyMagnetometer(GattCharacteristic sender, GattValueChangedEventArgs args)
 {
     byte[]  rawData = BLE_Utilities.getDataBytes(args);
     float[] vals    = SensorConvert.convertAccelerometer(rawData);
     await this.Dispatcher.BeginInvoke((Action)(() => setMagnetometer(vals[0], vals[1], vals[2])));
 }