Due to high demand expect some shipping delays at this time, orders may not ship for 3-4 business days. On MLK Day no orders will be shipped.
0

Question for BLE connect
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Question for BLE connect

by JoJoLyu on Sun Dec 05, 2021 4:43 am

I am working on a project as a toothbrushing timer. My goal is using adafruit clue as a slide show(activate by waving my hands) that shows the steps of brushing tooth, also the board will connect to my phone via bluetooth and send time count down that I can see the time count down on "bluefruitConnect". So far I am stuck with my code, when I run the code, it can only connect with my phone but the slideshow is not working, I do not know why, and if you can help I would be appreciated. my code are here,
import time
import board
from adafruit_ble import BLERadio
from adafruit_ble.advertising.standard import ProvideServicesAdvertisement
from adafruit_ble.services.nordic import UARTService

from adafruit_bluefruit_connect.packet import Packet
from adafruit_bluefruit_connect.button_packet import ButtonPacket
from adafruit_slideshow import SlideShow, PlayBackDirection
from adafruit_clue import clue

ble = BLERadio()
uart = UARTService()
advertisement = ProvideServicesAdvertisement(uart)

while True:
value = clue.gesture
ble.start_advertising(advertisement)
while not ble.connected:
pass
#connect bluetooth
while ble.connected:
if uart.in_waiting:
packet = Packet.from_stream(uart)
if isinstance(packet, ButtonPacket):
if packet.pressed:
if packet.button == ButtonPacket.BUTTON_1:
print("start brushing!")
if value:
slideshow = SlideShow(clue.display, auto_advance=False)
clue.pixel.fill((0, 0, 255))
if clue.button_a:
slideshow.direction = PlayBackDirection.FORWARD
slideshow.advance()

JoJoLyu
 
Posts: 4
Joined: Thu Dec 02, 2021 1:47 pm

Re: Question for BLE connect

by mikeysklar on Wed Dec 08, 2021 5:11 pm

Is there any output on the REPL console?

Have you tried running the basic slide show simple test example with files loaded to test it out?

https://circuitpython.readthedocs.io/pr ... tion-notes

Code: Select all | TOGGLE FULL SIZE
from adafruit_slideshow import PlayBackOrder, SlideShow
import board
import pwmio

slideshow = SlideShow(board.DISPLAY, pwmio.PWMOut(board.TFT_BACKLIGHT), folder="/",
                      loop=False, order=PlayBackOrder.ALPHABETICAL)

while slideshow.update():
    pass

mikeysklar
 
Posts: 6525
Joined: Mon Aug 01, 2016 8:10 pm

Please be positive and constructive with your questions and comments.