Skip to content

Commit

Permalink
motor set angle 동작 이슈 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
boobooboo2 committed Dec 18, 2024
1 parent 44e7886 commit 8073926
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modi_plus/module/output_module/motor.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,17 @@ def set_angle(self, target_angle: int, target_speed: int = 70) -> None:
:return: None
"""

if (target_angle < 0 or target_angle > 360)\
or (target_speed < 0 or target_speed > 100):
return

self._set_property(
destination_id=self._id,
property_num=Motor.PROPERTY_MOTOR_ANGLE,
property_values=(("u16", target_angle),
("u16", target_speed), )
("u16", target_speed),
("u16", 0),
("u16", 0), )
)
time.sleep(0.01)

Expand Down

0 comments on commit 8073926

Please sign in to comment.