Пример #1
0
 //Check Port One's Sensor SIValue for the distance between it and any Object infront of it.
 //If there is a collision about to occure, alert the user with vibrations on the Myo Armband and sound on the EV3 Brick.
 private async void CheckForCollision(float portOneValue)
 {
     if (portOneValue <= 45)
     {
         _MyMyo.Vibrate(VibrationType.Short);
         await _brick.DirectCommand.PlayToneAsync(5, 2000, 1000);
     }
     else if (portOneValue <= 35)
     {
         _MyMyo.Vibrate(VibrationType.Medium);
         await _brick.DirectCommand.PlayToneAsync(10, 3000, 2000);
     }
     else if (portOneValue <= 10)
     {
         _MyMyo.Vibrate(VibrationType.Long);
         await _brick.DirectCommand.PlayToneAsync(15, 4000, 3000);
     }
 }
Пример #2
0
 public void Vibrate(VibrationType vibType)
 {
     _myo.Vibrate(vibType);
 }