Exemple #1
0
        private void Sensor_Updated(object sender, Meadow.Peripherals.Sensors.Distance.DistanceConditionChangeResult e)
        {
            if (e.New == null || e.New.Distance == null)
            {
                return;
            }

            Console.WriteLine($"{e.New.Distance.Value}mm");
        }
        private void Sensor_Updated(object sender, Meadow.Peripherals.Sensors.Distance.DistanceConditionChangeResult e)
        {
            if (e.New == null || e.New.Distance == null)
            {
                return;
            }

            Console.WriteLine($"{e.New.Distance.Value}mm");

            graphics.DrawRectangle(0, 0, 135, 33, Color.Black, true);
            graphics.DrawText(0, 0, $"{e.New.Distance.Value}mm", Color.White, GraphicsLibrary.ScaleFactor.X2);
            graphics.Show();
        }