Esempio n. 1
0
 public VibrationDevice(ITactPlayConnection tactPlayConnection)
 {
     this.tactPlayConnection = tactPlayConnection;
     timerThread             = new Thread(() =>
     {
         var interval = new TimeSpan(0, 0, 0, 0, 5);
         var nextTick = DateTime.Now + interval;
         while (keepTimerThreadRunning)
         {
             while (DateTime.Now < nextTick)
             {
                 Thread.Sleep(Math.Max((nextTick - DateTime.Now).Milliseconds, 0));
             }
             OnTimedEvent();
             nextTick = DateTime.Now + interval;
         }
     });
     timerThread.Start();
 }
Esempio n. 2
0
 public BLEMotor(ITactPlayConnection connection, int motorID)
 {
     this.tactPlayConnection = connection;
     this.motorID            = Convert.ToByte(motorID);
 }