light.py

# هذا العمل مرخص بموجب ترخيص MIT.
# حقوق النشر (c) 2013-2026 لشركة OpenMV LLC. جميع الحقوق محفوظة.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# يوضح هذا المثال استخدام درع الإضاءة مع وحدة الآلة (Machine Module).

import time
from machine import PWM, Pin

# 50 كيلوهرتز، الدبوس 6، المؤقت 2، القناة 1
pwm = PWM(Pin("P6"), freq=50000, duty_u16=0)

while True:
    for i in range(101):
        pwm.duty_u16((i * 65535) // 100)
        time.sleep_ms(10)
    for i in range(101):
        pwm.duty_u16(((100 - i) * 65535) // 100)
        time.sleep_ms(10)

results matching ""

    No results matching ""