Beispiel #1
0
 private async Task LunchFollowMe()
 {
     EV3TouchSensor touch = new EV3TouchSensor(BrickPortSensor.PORT_S1);
     NXTUltraSonicSensor ultra = new NXTUltraSonicSensor(BrickPortSensor.PORT_S3, UltraSonicMode.Centimeter);
     robot = new Vehicule(BrickPortMotor.PORT_B, BrickPortMotor.PORT_C);
     while (!touch.IsPressed())
     {
         int valultra = ultra.Value;
         if ((valultra < 70) && (valultra!=0))
         {
             Debug.WriteLine($"Taking picture, distance {valultra} cm");
             await MakePicture();
         }
             
         await Task.Delay(10);
     }
     Debug.Write("end of face tracking and detection");
 }