Skip to content

Commit 9c2c793

Browse files
committed
Create BreathLamp1.py
1 parent 400e0a1 commit 9c2c793

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

boards/bearpi/PWM/BreathLamp1.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
'''
2+
3+
BEARPI Breathing Lamp demo1
4+
5+
'''
6+
7+
from misc import PWM
8+
from utime import sleep_ms
9+
10+
pwm = PWM(PWM.PWM0, 1, 20)
11+
pwm.open()
12+
13+
while 1:
14+
for i in range(20):
15+
pwm = PWM(PWM.PWM0, i+1, 20)
16+
sleep_ms(50)

0 commit comments

Comments
 (0)