public void CanMoveServo(byte id, CommunicationObject sender) { var movment1 = new MovmentComandAX12(id, 0x0ff, 0x150); var movment2 = new MovmentComandAX12(id, 0x1ff, 0x150); var instructionPacket = new InstructionPacketSyncMovment(sender, movment1); instructionPacket.Send(); Thread.Sleep(2000); instructionPacket = new InstructionPacketSyncMovment(sender, movment2); instructionPacket.Send(); sender.Dispose(); }
public void CanMoveServo5() { ISender sender = new CommunicationObject("COM4"); var movment1 = new MovmentComandAX12(5, 0x0ff, 0x150); var movment2 = new MovmentComandAX12(3, 0x0ff, 0x150); var instructionPacket = new InstructionPacketSyncMovment(sender, movment1, movment2); instructionPacket.Send(); ((CommunicationObject) sender).Dispose(); }
public void MoveBodyToStartPosition3() { ISender sender = new CommunicationObject(COMPORT); Phoenix phoenix = RobotFactory.CreatePhoenix(HomePositionFactory.CreateHomePosition4()); var movments = phoenix.GetMovements(); var instructionPacket = new InstructionPacketSyncMovment(sender, movments); instructionPacket.Send(); Thread.Sleep((int)ServoBase.TimeBox * 1000); for (int i = 0; i < 15; i++) { phoenix.MoveBody(0, 90, -1); movments = phoenix.GetMovements(); instructionPacket = new InstructionPacketSyncMovment(sender, movments); instructionPacket.Send(); Thread.Sleep((int)ServoBase.TimeBox * 1000 - 10); } for (int i = 0; i < 15; i++) { phoenix.MoveBody(0, 90, 1); movments = phoenix.GetMovements(); instructionPacket = new InstructionPacketSyncMovment(sender, movments); instructionPacket.Send(); Thread.Sleep((int)ServoBase.TimeBox * 1000 + 10); } ((CommunicationObject)sender).Dispose(); }
public void RotateBody15degresCW() { ISender sender = new CommunicationObject(COMPORT); Phoenix phoenix = RobotFactory.CreatePhoenix(HomePositionFactory.CreateHomePosition()); phoenix.RotateBody(40,1); var movments = phoenix.GetMovements(); var instructionPacket = new InstructionPacketSyncMovment(sender, movments); instructionPacket.Send(); ((CommunicationObject)sender).Dispose(); }
public void MoveBodyToStartPosition() { ISender sender = new CommunicationObject("COM4"); Phoenix phoenix = RobotFactory.CreatePhoenix(HomePositionFactory.CreateHomePosition()); var movments = phoenix.GetMovements(); var instructionPacket = new InstructionPacketSyncMovment(sender, movments); instructionPacket.Send(); ((CommunicationObject)sender).Dispose(); }