Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs1-24fa
lecture-code
Commits
643fec5b
Commit
643fec5b
authored
6 months ago
by
Adam Blank
Browse files
Options
Download
Email Patches
Plain Diff
autocommit
parent
f5fd921f
master
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
07/code.py
+10
-3
07/code.py
with
10 additions
and
3 deletions
+10
-3
07/code.py
View file @
643fec5b
...
...
@@ -3,18 +3,25 @@ try:
import
neopixel
from
adafruit_apds9960.apds9960
import
APDS9960
import
touchio
import
supervisor
supervisor
.
runtime
.
autoreload
=
True
except
ModuleNotFoundError
:
pass
else
:
from
interact
import
run
print
(
"Setting up Trinkey..."
)
# Setup board
i2c
=
board
.
I2C
()
apds
=
APDS9960
(
i2c
)
pixels
=
neopixel
.
NeoPixel
(
board
.
NEOPIXEL
,
2
)
pixels
=
neopixel
.
NeoPixel
(
board
.
NEOPIXEL
,
2
,
brightness
=
0.
2
)
touch
=
touchio
.
TouchIn
(
board
.
TOUCH2
)
apds
.
enable_proximity
=
True
print
(
"Loaded Trinkey..."
)
# Call our run function
run
(
apds
,
pixels
,
touch
)
print
(
"Starting our code!"
)
try
:
run
(
apds
,
pixels
,
touch
)
except
KeyboardInterrupt
:
print
(
"asdf"
)
pass
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help