Due to high demand, expect some shipping delays at this time - orders may not ship for up to 2-3 business days.
0

Scrolling Text - LED GlassesIS31FL3741 I2C Driver
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Scrolling Text - LED GlassesIS31FL3741 I2C Driver

by Powderjockey on Tue Nov 09, 2021 11:53 pm

Can one of the good people in these forums point me to a tutorial for getting the these glasses to show scrolling text?

Thanks

Scott

Powderjockey
 
Posts: 170
Joined: Fri Mar 31, 2017 10:14 pm

Re: Scrolling Text - LED GlassesIS31FL3741 I2C Driver

by dastels on Wed Nov 10, 2021 10:50 pm


dastels
 
Posts: 9746
Joined: Tue Oct 20, 2015 3:22 pm

Re: Scrolling Text - LED GlassesIS31FL3741 I2C Driver

by Powderjockey on Thu Nov 11, 2021 1:14 pm

Thanks Dave. I had looked at that, but didn't any further than having the App look for the device. My phone sees a million bluetooth devices, but not the IS31FL3741 board.

I have a green light and have loaded the "blink" demo and the red light is slowly blinking away.

My laptop does not see it either.

Is there a way to turn on the BT or check?

Powderjockey
 
Posts: 170
Joined: Fri Mar 31, 2017 10:14 pm

Re: Scrolling Text - LED GlassesIS31FL3741 I2C Driver

by dastels on Thu Nov 11, 2021 2:33 pm


dastels
 
Posts: 9746
Joined: Tue Oct 20, 2015 3:22 pm

Re: Scrolling Text - LED GlassesIS31FL3741 I2C Driver

by osbor on Fri Nov 12, 2021 2:25 am

Chiming in to say I'm having the same issue. The 020 glasses are not showing up in the blue fruit ble app for me either. Do they not have the code on board by default to be configurable through the app?

osbor
 
Posts: 10
Joined: Wed Mar 20, 2013 3:40 am

Re: Scrolling Text - LED GlassesIS31FL3741 I2C Driver

by dastels on Fri Nov 12, 2021 9:20 am

The code running on the driver board has to use bluetooth for it to show up and be connectable. I don't know what's on there by default, but I did just manage to order the driver and display boards. I'll be able to dig into it after they arrive next week.

Dave

dastels
 
Posts: 9746
Joined: Tue Oct 20, 2015 3:22 pm

Re: Scrolling Text - LED GlassesIS31FL3741 I2C Driver

by jerryn on Fri Nov 12, 2021 9:40 am

The default code does not have any BLE functionality. You have to load this demo https://learn.adafruit.com/adafruit-eyelights-led-glasses-and-driver/bluetooth-message-scroller -- There is a .uf2 file provided so just drag/drop it to the board after putting it into bootloader mode (double tap reset).

jerryn
 
Posts: 1719
Joined: Sat Sep 14, 2013 9:05 am

Re: Scrolling Text - LED GlassesIS31FL3741 I2C Driver

by Powderjockey on Sun Nov 14, 2021 2:27 pm

I was able to get the BT functionality to work by loading the scripting at https://learn.adafruit.com/adafruit-cir ... cuitpython

Then, in Arduino, if you load the example Glassesdemo3-smooth, the glasses will show the scrolling "Adafruit" as at the top of the learn page for the glasses. I don't see a CircuitPython equivalent on the page. You have to load the boards and the libraries in order to get the examples.

I'm struggling to change colours on the glasses in the script

Code: Select all | TOGGLE FULL SIZE
// Animate the LED rings with a color wheel.
  for (int i=0; i < glasses.left_ring.numPixels(); i++) {
    glasses.left_ring.setPixelColor(i, glasses.ColorHSV(
      ring_hue + i * 65536 / glasses.left_ring.numPixels()));
  }
  for (int i=0; i < glasses.right_ring.numPixels(); i++) {
    glasses.right_ring.setPixelColor(i, glasses.ColorHSV(
      ring_hue - i * 65536 / glasses.right_ring.numPixels()));
  }
  ring_hue += 1000; // Shift color a bit on next frame - makes it spin

Powderjockey
 
Posts: 170
Joined: Fri Mar 31, 2017 10:14 pm

Re: Scrolling Text - LED GlassesIS31FL3741 I2C Driver

by dpn982 on Sun Nov 14, 2021 7:02 pm

Is this what you are looking for:

Code: Select all | TOGGLE FULL SIZE
import time
import board
from busio import I2C
import adafruit_is31fl3741
from adafruit_is31fl3741.adafruit_ledglasses import LED_Glasses
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.color_packet import ColorPacket


i2c = I2C(board.SCL, board.SDA, frequency=1000000)

# Initialize the IS31 LED driver, buffered for smoother animation
glasses = LED_Glasses(i2c, allocate=adafruit_is31fl3741.MUST_BUFFER)
glasses.show()  # Clear any residue on startup
glasses.global_current = 20  # Just middlin' bright, please

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

while True:
        ble.start_advertising(advertisement)
        while not ble.connected:
            pass
        ble.stop_advertising()

        while ble.connected:
            if uart.in_waiting:
                packet = Packet.from_stream(uart)
                if isinstance(packet, ColorPacket):
                    rgb_int = packet.color[0] << 16 | packet.color[1] << 8 | packet.color[2]
                    glasses.right_ring.fill(rgb_int)
                    glasses.left_ring.fill(rgb_int)
                glasses.show()
            pass
       
   pass


That should change the color rings to the value sent from the bluefruit app. I can not figure out how to get the text from the app though.

dpn982
 
Posts: 10
Joined: Mon Feb 10, 2014 2:29 pm

Re: Scrolling Text - LED GlassesIS31FL3741 I2C Driver

by Powderjockey on Sun Nov 14, 2021 10:05 pm

Wow! Thanks @dpn982!

I uploaded your script and now the rings are orange, but I can't see the device on the Bluefruit Connect app.

My next question in all of this and it goes to all of the programming and not in particular these devices, but where can I find what all goes with the commands? Such as:

Code: Select all | TOGGLE FULL SIZE
glasses.[b]show([/b])  # Clear any residue on startup
glasses.[b]global_current [/b]= 20  # Just middlin' bright, please


I've asked on different forums and for different types of programming languages and never get a proper answer.

Thanks again and I will play with this script.
Scott

Powderjockey
 
Posts: 170
Joined: Fri Mar 31, 2017 10:14 pm

Re: Scrolling Text - LED GlassesIS31FL3741 I2C Driver

by Powderjockey on Sun Nov 14, 2021 10:56 pm

OK, little bit of fun. In ,y previous post I said there were orange rings and not BT. So, no libraries from the code on the board means no BT. So I added the missing libraries, but the library 'adafruit_bluefruit_connect' seems to do something that causes the device to need a soft reboot. Upon the soft reboot it says the same thing. So I remove the library and it tells me the library is missing.

Using the Bluefruit Connect app, there is a cirpy that shows up with out the 'adafruit_bluefruit_connect' library, but when it says it is connected, it does nothing.

the Serial output for the 2 are below:

Code: Select all | TOGGLE FULL SIZE
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:

Code stopped by auto-reload.
soft reboot

Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
  File "code.py", line 9, in <module>
ImportError: no module named 'adafruit_bluefruit_connect'

Code done running.

Powderjockey
 
Posts: 170
Joined: Fri Mar 31, 2017 10:14 pm

Re: Scrolling Text - LED GlassesIS31FL3741 I2C Driver

by dpn982 on Sun Nov 14, 2021 11:51 pm

Here is what I have in the lib folder:

Screenshot 2021-11-14 224723.png
Screenshot 2021-11-14 224723.png (20.77 KiB) Viewed 594 times


There doesn't seem to be much in the way of documentation on this box posted yet. I have been piecing together stuff from examples that I found in the circuitpython libs zip. Not sure if all the things that I put in the libs folder are needed or not, but it works with them all in there.

dpn982
 
Posts: 10
Joined: Mon Feb 10, 2014 2:29 pm

Re: Scrolling Text - LED GlassesIS31FL3741 I2C Driver

by Powderjockey on Wed Nov 17, 2021 9:40 pm

Have the lib folder the same as your image. I have nothing showing on the glasses now. No orange circles, no nothing. There is a small red LED on the is31fl3741 board that blinks once in a while.

Powderjockey
 
Posts: 170
Joined: Fri Mar 31, 2017 10:14 pm

Re: Scrolling Text - LED GlassesIS31FL3741 I2C Driver

by dastels on Thu Nov 18, 2021 7:50 pm

With the libs dpn982 listed, and a slight change to their code, it works to connect to the bluefruit app and let me change colors with the colorpicker.
Code: Select all | TOGGLE FULL SIZE
import time
import board
from busio import I2C
import adafruit_is31fl3741
from adafruit_is31fl3741.adafruit_ledglasses import LED_Glasses
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.color_packet import ColorPacket


i2c = I2C(board.SCL, board.SDA, frequency=1000000)

# Initialize the IS31 LED driver, buffered for smoother animation
glasses = LED_Glasses(i2c, allocate=adafruit_is31fl3741.MUST_BUFFER)
glasses.show()  # Clear any residue on startup
glasses.global_current = 20  # Just middlin' bright, please

glasses.left_ring.fill(0x880000)
glasses.right_ring.fill(0x008800)
glasses.show()

print("Setting up BLE")

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

print("BLE set up")

while True:
    print("Advertising")
    ble.start_advertising(advertisement)
    while not ble.connected:
        pass
    print("Connected")
    ble.stop_advertising()

    while ble.connected:
        if uart.in_waiting:
            packet = Packet.from_stream(uart)
            if isinstance(packet, ColorPacket):
                rgb_int = packet.color[0] << 16 | packet.color[1] << 8 | packet.color[2]
                glasses.right_ring.fill(rgb_int)
                glasses.left_ring.fill(rgb_int)
                glasses.show()

Dave

dastels
 
Posts: 9746
Joined: Tue Oct 20, 2015 3:22 pm

Re: Scrolling Text - LED GlassesIS31FL3741 I2C Driver

by Powderjockey on Fri Nov 19, 2021 4:21 pm

Thanks a ton Dave. Great starting point.

Do you know if the Ble app allows of the input of text?

Powderjockey
 
Posts: 170
Joined: Fri Mar 31, 2017 10:14 pm

Please be positive and constructive with your questions and comments.