servo_control.py

# この作品はMITライセンスの下で提供されています。
# Copyright (c) 2013-2023 OpenMV LLC. 全著作権所有。
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# サーボ制御の例
#
# この例では、OpenMV Camを使用してサーボを制御する方法を示します。

import time
from pyb import Servo

s1 = Servo(1)  # P7
s2 = Servo(2)  # P8
s3 = Servo(3)  # P9

while True:
    for i in range(1000):
        s1.pulse_width(1000 + i)
        s2.pulse_width(1999 - i)
        s3.pulse_width(1000 + i)
        time.sleep_ms(10)
    for i in range(1000):
        s1.pulse_width(1999 - i)
        s2.pulse_width(1000 + i)
        s3.pulse_width(1999 - i)
        time.sleep_ms(10)

results matching ""

    No results matching ""