Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NEW LIGHT] Adafruit M4 Express / NeoTrellis #270

Closed
andrewwatson opened this issue May 31, 2023 · 5 comments
Closed

[NEW LIGHT] Adafruit M4 Express / NeoTrellis #270

andrewwatson opened this issue May 31, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request new light Request to support a new device

Comments

@andrewwatson
Copy link

If you would like BusyLight to support a new device, please provide as much of the following as possible.

I have one of these built and I've been writing some Circuit Python on it and I've started work on adapting the trinket code for the neotrellis. I opened this issue to start a discussion about whether any changes to busylight would be necessary

@andrewwatson andrewwatson added the new light Request to support a new device label May 31, 2023
@JnyJny
Copy link
Owner

JnyJny commented May 31, 2023

Interesting. Just skimming the docs for those devices, I imagine that BusyLight would be on the M4 controlling the lights which are either accessed via GPIO or I2C. BusyLight currently support USB HID and serial "backends" via busylight.lights.USBLight and busylight.lights.SerialLight. So I guess we would want to add busylight.lights.I2CLight and possibly busylight.lights.GPIOLight (I think your intent is support for NeoTrellis attached via I2C according to the docs, so GPIO might just be a nice to have but not necessary).

I think my biggest concern is light discovery; both HIDAPI and USBSerial have the ability to query available devices and I've spent a lot of time on abstracting the Light API to make it usable without having to know the specifics of a connected device. It might be that I2C/GPIO breaks some of that ease of use, but presumably people using the M4/NeoTrellis devices are a little more technically savvy and up to the task of knowing what lights are available a priori and what "flavor" of device is connected.

I'm not opposed to supporting this combination, but I'll have to spin up on I2C/CircuitPython/etc or have some really good pull requests to work with :)

@JnyJny JnyJny added the enhancement New feature or request label May 31, 2023
@andrewwatson
Copy link
Author

Well, I haven't really been able to dig into all the magic in busylight yet but I was thinking that on the M4 itself the code could be pretty much this https://github.com/freemansoft/Adafruit-Trinkey-CircuitPython or something similar. BusyLight would just have to be able to detect the device was present (HID) and send it signals over... serial console? I'm not sure, actually.

I've got CircuitPython on my M4/NeoTrellis now that plays animated 4x4 sequences when you press its own buttons and "types" things as if it was a keyboard. I just need to have some way of sending it messages from the host to trigger lights / sequences.
It could be that it's not a great fit for the model you've already been working with but I'm curious to try and get something working.

@JnyJny
Copy link
Owner

JnyJny commented May 31, 2023

I suspect, for your application, BusyLight is overkill as it is essentially "wallpaper" over the weirdness of talking to USB devices (HID and serial) and the wildly disparate command architectures of various commercial lights. I don't know how your NeoTrellis is connected physically to your M4, but my suspicion is via the I2C bus and not a USB connection. A brief survey of this article seems to indicate that scanning an I2C bus for devices and writing to them is relatively simple.

That said, I'm still willing to entertain the idea of adding I2C support to BusyLight. I've got a Feather lying around somewhere, just need to acquire a NeoTrellis to play with.

@JnyJny
Copy link
Owner

JnyJny commented May 31, 2023

One thing just occurred to me. Most of the lights supported by BusyLight don't permit individual access to component lights and so the method busylight.light.Light.on((R, G, B)) turns the light on with color tuple (R, G, B). There is a precedent for specific lights supporting LED addressability; busylight.light.luxafor.Flag family of lights for instance have a leds attribute that controls which LEDs are turned on and off. IIRC the BlickStick family also has addressable LEDs, but BusyLight treats it as just one light as well.

All this to say, the BusyLight model might not give you the ease of use you were looking for (at least not right away).

@andrewwatson
Copy link
Author

andrewwatson commented Jun 2, 2023 via email

@JnyJny JnyJny closed this as completed Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new light Request to support a new device
Projects
None yet
Development

No branches or pull requests

2 participants