Esempio n. 1
0
 public MainPage()
 {
     this.InitializeComponent();
     _servoDriver = new ServoDriver(18, new ServoPulseModel
     {
         ForwardPulseWidth  = 2,
         BackwardPulseWidth = 1,
         PulseFrequency     = 20
     });
     _ledDriver  = new LedDriver(4);
     _connection = new HubConnection("http://ipwebapp.azurewebsites.net/");
     _hubProxy   = _connection.CreateHubProxy("bandHub");
     _hubProxy.On <string>("sendData", x =>
     {
         if (x == "left")
         {
             _servoDriver.Clockwise();
         }
         else if (x == "right")
         {
             _servoDriver.CounterClockwise();
         }
     });
     _connection.Start().Wait();
 }
Esempio n. 2
0
 private void Button_Click_Right(object sender, RoutedEventArgs e)
 {
     _servoDriver.CounterClockwise();
 }