Merge pull request #626 from kidswong999/patch-2

Add example for light shield
This commit is contained in:
Ibrahim Abd Elkader 2019-10-27 12:21:49 +02:00 committed by GitHub
commit 28835b10e2
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)