Skip to content

Commit 6010547

Browse files
committed
basic colors tested
1 parent 52f3962 commit 6010547

File tree

2 files changed

+43
-19
lines changed

2 files changed

+43
-19
lines changed

examples/25-neopixel/main.py

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
2+
# https://wiki.dfrobot.com/FireBeetle_Board_ESP32_E_SKU_DFR0654
3+
# https://docs.micropython.org/en/latest/library/neopixel.html
4+
5+
from machine import Pin
6+
from neopixel import NeoPixel
7+
import time
8+
9+
10+
np = NeoPixel(Pin(5), 1)
11+
12+
# Draw a red gradient
13+
for i in range(16):
14+
np[0] = (i*8, 0, 0)
15+
np.write()
16+
time.sleep(.1)
17+
18+
np[0] = (128, 128, 0)
19+
np.write()
20+
time.sleep(1)
21+
22+
np[0] = (0, 128, 0)
23+
np.write()
24+
time.sleep(1)
25+
26+
np[0] = (0, 128, 128)
27+
np.write()
28+
time.sleep(1)
29+
30+
np[0] = (0, 0, 128)
31+
np.write()
32+
time.sleep(1)
33+
34+
np[0] = (128, 0, 128)
35+
np.write()
36+
time.sleep(1)
37+
38+
np[0] = (128, 0, 0)
39+
np.write()
40+
time.sleep(1)
41+
42+
np[0] = (0, 0, 0)
43+
np.write()

examples/main.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)