public Arm(string name, NxtMotor shoulderAlong, NxtMotor shoulderOut, NxtMotor elbowAlong, NxtMotor elbowOut) { ShoulderAlong = new Joint(shoulderAlong, name+"ShoulderAlong") {DegreeScaleFactor = 24, MinAngle = -270, MaxAngle = 270}; ShoulderOut = new Joint(shoulderOut, name + "ShoulderOut") { DegreeScaleFactor = 24, MinAngle = 0, MaxAngle = 200 }; ElbowAlong = new Joint(elbowAlong, name + "ElbowAlong") { Power = 10, MinAngle = 0, MaxAngle = 115 }; ElbowOut = new Joint(elbowOut, name + "ElbowOut") { Power = 10, MinAngle = -100, MaxAngle = 100 }; }
private void SetAngle(Joint joint, int? angle) { if (angle.HasValue) joint.TargetAngle = angle.Value; }