Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
5c37e76e
Commit
5c37e76e
authored
Jan 26, 2021
by
Christopher Tse
Committed by
Damien George
Jan 30, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
esp8266/modules/neopixel.py: Add timing param to NeoPixel constructor.
This matches the esp32 port.
parent
993ab6aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
ports/esp8266/modules/neopixel.py
ports/esp8266/modules/neopixel.py
+3
-2
No files found.
ports/esp8266/modules/neopixel.py
View file @
5c37e76e
...
...
@@ -7,12 +7,13 @@ from esp import neopixel_write
class
NeoPixel
:
ORDER
=
(
1
,
0
,
2
,
3
)
def
__init__
(
self
,
pin
,
n
,
bpp
=
3
):
def
__init__
(
self
,
pin
,
n
,
bpp
=
3
,
timing
=
1
):
self
.
pin
=
pin
self
.
n
=
n
self
.
bpp
=
bpp
self
.
buf
=
bytearray
(
n
*
bpp
)
self
.
pin
.
init
(
pin
.
OUT
)
self
.
timing
=
timing
def
__setitem__
(
self
,
index
,
val
):
offset
=
index
*
self
.
bpp
...
...
@@ -28,4 +29,4 @@ class NeoPixel:
self
[
i
]
=
color
def
write
(
self
):
neopixel_write
(
self
.
pin
,
self
.
buf
,
True
)
neopixel_write
(
self
.
pin
,
self
.
buf
,
self
.
timing
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment