Skip to content

Commit 53c45e5

Browse files
committed
Create BreathLamp2.py
1 parent 9c2c793 commit 53c45e5

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

boards/bearpi/PWM/BreathLamp2.py

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

0 commit comments

Comments
 (0)