Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
HepiaLight3 - RBPi Pico
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
michael.divia
HepiaLight3 - RBPi Pico
Commits
60eb340f
Commit
60eb340f
authored
1 year ago
by
michael.divia
Browse files
Options
Downloads
Patches
Plain Diff
First try at Matrix function
parent
446b4aee
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
1 - Code/color.py
+7
-0
7 additions, 0 deletions
1 - Code/color.py
1 - Code/main.py
+3
-10
3 additions, 10 deletions
1 - Code/main.py
1 - Code/matrix.py
+11
-0
11 additions, 0 deletions
1 - Code/matrix.py
with
21 additions
and
10 deletions
1 - Code/color.py
0 → 100644
+
7
−
0
View file @
60eb340f
class
Color
:
BLACK
=
(
0
,
0
,
0
)
BLUE
=
(
0
,
0
,
255
)
CYAN
=
(
0
,
255
,
255
)
GREEN
=
(
0
,
255
,
0
)
MAGENTA
=
(
255
,
0
,
255
)
RED
=
(
255
,
0
,
0
)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
1 - Code/main.py
+
3
−
10
View file @
60eb340f
from
machine
import
Pin
from
machine
import
Pin
from
neopixel
import
NeoPixel
from
neopixel
import
NeoPixel
import
time
from
matrix
import
matrix
from
color
import
color
pin
=
Pin
(
0
,
Pin
.
OUT
)
# set GPIO0 to output to drive NeoPixels
pin
=
Pin
(
0
,
Pin
.
OUT
)
# set GPIO0 to output to drive NeoPixels
np
=
NeoPixel
(
pin
,
64
)
# create NeoPixel driver on GPIO0 for 64 pixels
np
=
NeoPixel
(
pin
,
64
)
# create NeoPixel driver on GPIO0 for 64 pixels
while
True
:
while
True
:
for
j
in
range
(
3
):
matrix
.
clear
(
color
.
RED
)
for
i
in
range
(
0
,
64
):
\ No newline at end of file
if
j
==
0
:
np
[
i
]
=
(
255
,
0
,
0
)
elif
j
==
1
:
np
[
i
]
=
(
0
,
255
,
0
)
elif
j
==
2
:
np
[
i
]
=
(
0
,
0
,
255
)
np
.
write
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
1 - Code/matrix.py
0 → 100644
+
11
−
0
View file @
60eb340f
from
machine
import
Pin
from
neopixel
import
NeoPixel
from
color
import
color
pin
=
Pin
(
0
,
Pin
.
OUT
)
# set GPIO0 to output to drive NeoPixels
np
=
NeoPixel
(
pin
,
64
)
# create NeoPixel driver on GPIO0 for 64 pixels
class
matrix
:
def
clear
(
self
,
color
):
for
i
in
range
(
0
,
64
):
np
[
i
]
=
color
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment