Skip to content

Commit

Permalink
Merge pull request #90 from nnja/fix_color_picker_example_for_animation
Browse files Browse the repository at this point in the history
Fix color picker example for animation
  • Loading branch information
dhalbert authored Jun 14, 2020
2 parents 5d58457 + cceaf0d commit 3585131
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions examples/ble_bluefruit_color_picker.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
from adafruit_bluefruit_connect.color_packet import ColorPacket

ble = BLERadio()
uart_server = UARTService()
advertisement = ProvideServicesAdvertisement(uart_server)
uart_service = UARTService()
advertisement = ProvideServicesAdvertisement(uart_service)

pixels = neopixel.NeoPixel(board.NEOPIXEL, 10, brightness=0.1)

Expand All @@ -22,7 +22,8 @@
ble.stop_advertising()

while ble.connected:
packet = Packet.from_stream(uart_server)
if isinstance(packet, ColorPacket):
print(packet.color)
pixels.fill(packet.color)
if uart_service.in_waiting:
packet = Packet.from_stream(uart_service)
if isinstance(packet, ColorPacket):
print(packet.color)
pixels.fill(packet.color)

0 comments on commit 3585131

Please sign in to comment.