Skip to content

Commit c36285e

Browse files
authored
Merge pull request #629 from dastels/lightbox
Add lightbox code and STLs
2 parents 60b5582 + 6089458 commit c36285e

6 files changed

Lines changed: 40 additions & 0 deletions

File tree

lightbox/STLs/SB-Feather_Tray.stl

376 KB
Binary file not shown.

lightbox/STLs/corner_clip.stl

2.62 KB
Binary file not shown.

lightbox/STLs/lightbox.stl

39.1 KB
Binary file not shown.

lightbox/STLs/paper_clip.stl

16.1 KB
Binary file not shown.

lightbox/STLs/side_clip.stl

2.23 KB
Binary file not shown.

lightbox/code.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"""
2+
Lightbox driver program.
3+
4+
Adafruit invests time and resources providing this open source code.
5+
Please support Adafruit and open source hardware by purchasing
6+
products from Adafruit!
7+
8+
Written by Dave Astels for Adafruit Industries
9+
Copyright (c) 2018 Adafruit Industries
10+
Licensed under the MIT license.
11+
12+
All text above must be included in any redistribution.
13+
"""
14+
15+
import board
16+
import neopixel
17+
from adafruit_ble.uart import UARTServer
18+
from adafruit_bluefruit_connect.packet import Packet
19+
from adafruit_bluefruit_connect.color_packet import ColorPacket
20+
21+
pixel_pin = board.A0
22+
num_pixels = 20
23+
24+
pixels = neopixel.NeoPixel(pixel_pin, num_pixels)
25+
26+
uart_server = UARTServer()
27+
28+
while True:
29+
uart_server.start_advertising()
30+
while not uart_server.connected:
31+
pass
32+
33+
# Now we're connected
34+
35+
while uart_server.connected:
36+
if uart_server.in_waiting:
37+
packet = Packet.from_stream(uart_server)
38+
if isinstance(packet, ColorPacket):
39+
# Change the NeoPixel color.
40+
pixels.fill(packet.color)

0 commit comments

Comments
 (0)