light example for light shield

This commit is contained in:
王开智 2019-10-27 15:03:25 +08:00 committed by GitHub
parent d48b90d770
commit 706e4118fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,9 @@
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)