openmv/scripts/examples/33-Light-Shield/light.py
2019-10-27 15:03:25 +08:00

10 lines
223 B
Python

import time
from pyb import Pin, Timer
# 50kHz pin6 timer2 channel1
light = Timer(2, freq=50000).channel(1, Timer.PWM, pin=Pin("P6"))
light.pulse_width_percent(100) # adjust light 0~100
while (True):
time.sleep(1000)