public void ControlMotoDriver(Boolean onoff)
 {
     if (onoff)
     {
         motor.drive1(100);
         motor.drive2(100);
     }
     else
     {
         motor.drive1(0);
         motor.drive2(0);
     }
 }
        private void Timer_tick(ThreadPoolTimer timer)
        {
            try
            {
                if (direction)
                {
                    speed += 1;
                }
                else
                {
                    speed -= 1;
                }

                if (speed > 40)
                {
                    direction = false;
                }
                if (speed < -40)
                {
                    direction = true;
                }
                motor.drive1(speed);
                motor.drive2(-speed);
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
            }
        }