mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #626 from kidswong999/patch-2
Add example for light shield
This commit is contained in:
commit
28835b10e2
9
scripts/examples/33-Light-Shield/light.py
Normal file
9
scripts/examples/33-Light-Shield/light.py
Normal 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)
|
||||
Loading…
Reference in New Issue
Block a user