Example #1
0
 private void PollSensorAndFireEventIfNeeded()
 {
     double dist = distanceSensor.GetDistance(relativeDirection, minMapValueForObstacles, maxDistance);
     if (dist < maxDistance)
         OnWallDetected?.Invoke(dist);
 }
Example #2
0
 private void _timer_Tick(object sender, object e)
 {
     distanceLabel.Text = String.Format("Distance: {0} cm", ((long)_distance.GetDistance()).ToString());
 }