示例#1
0
 public void Can_Dock_Roomba()
 {
     using (var roomba = new RoombaCreate(BT_NAME, CommunicationMethod.Bluetooth))
     {
         roomba.Start();
         roomba.Dock();
     }
 }
示例#2
0
        public void Can_UnDock_Roomba()
        {
            int reverseTime = 5000;

            using (var roomba = new RoombaCreate(BT_NAME, CommunicationMethod.Bluetooth))
            {
                roomba.Start();
                roomba.Control();
                roomba.Reverse();
                System.Threading.Thread.Sleep(reverseTime);
                roomba.Stop();
                roomba.PowerDown();
            }
        }
示例#3
0
        public void Can_Turn_Roomba()
        {
            int turnTime = 5000;

            using (var roomba = new RoombaCreate(BT_NAME, CommunicationMethod.Bluetooth))
            {
                roomba.Start();
                roomba.Control();
                roomba.TurnRight();
                System.Threading.Thread.Sleep(turnTime);
                roomba.Stop();
                roomba.TurnLeft();
                System.Threading.Thread.Sleep(turnTime);
                roomba.Stop();
                roomba.PowerDown();
            }
        }
示例#4
0
        public void Can_Move_Roomba_BlueTooth()
        {
            int forwardTime = 1500;
            int reverseTime = 2000;
            int stopTime    = 5000;

            using (var roomba = new RoombaCreate(BT_NAME, CommunicationMethod.Bluetooth))
            {
                roomba.Start();
                roomba.Control();
                roomba.Forward();
                System.Threading.Thread.Sleep(forwardTime);
                roomba.Stop();
                System.Threading.Thread.Sleep(stopTime);
                roomba.Reverse();
                System.Threading.Thread.Sleep(reverseTime);
                roomba.Stop();
                roomba.PowerDown();
            }
        }
示例#5
0
        public void Can_Move_Roomba_Serial()
        {
            int forwardTime = 1500;
            int reverseTime = 2000;
            int stopTime    = 5000;

            using (var roomba = new RoombaCreate("COM3"))
            {
                roomba.Start();
                roomba.Control();
                roomba.Forward();
                System.Threading.Thread.Sleep(forwardTime);
                roomba.Stop();
                System.Threading.Thread.Sleep(stopTime);
                roomba.Reverse();
                System.Threading.Thread.Sleep(reverseTime);
                roomba.Stop();
                roomba.PowerDown();
            }
        }