Exemplo n.º 1
0
        /// <summary>
        /// Read Seneor Data
        /// </summary>
        public MLX90614Data Read()
        {
            byte[]       readBuf = new byte[2];
            MLX90614Data data    = new MLX90614Data();

            sensor.WriteRead(new byte[] { MLX90614_AMBIENT_TEMP }, readBuf);
            data.AmbientTemp = BitConverter.ToInt16(readBuf, 0) * 0.02 - 273.15;
            sensor.WriteRead(new byte[] { MLX90614_OBJECT_TEMP }, readBuf);
            data.ObjectTemp = BitConverter.ToInt16(readBuf, 0) * 0.02 - 273.15;

            return(data);
        }
Exemplo n.º 2
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            MLX90614 sensor = new MLX90614();
            await sensor.InitializeAsync();

            while (true)
            {
                MLX90614Data data = sensor.Read();

                Debug.WriteLine("Ambient : " + data.AmbientTemp + " ℃");
                Debug.WriteLine("Object : " + data.ObjectTemp + " ℃");

                await Task.Delay(2000);
            }
        }