Legion2 / CorsairLightingProtocol

Control LEDs connected to an Arduino with iCUE, create an unofficial Corsair iCUE compatible Arduino LED controller.
Apache License 2.0
499 stars 64 forks source link

Using together with a SPI display #341

Closed HasseM closed 11 months ago

HasseM commented 1 year ago

I am adding a 1.14" SPI display to my Pico but I run into compatability issues. I need some hints on where I should look and/or internal workings of CorsairLightningProtocol that may be conflicting.

Using this display: https://www.waveshare.com/wiki/Pico-LCD-1.14

I have this display working seperately as well I have corsairLightningProtocol working seperately on my RPi Pico board. (I have defines and ifdefs to turn on/off the one or the other). When both are active in the same project the whole devices locks-up to a point were 'usb device not recognized' and I need to hold the button during power-cycle and load exported uf2 files on it manually.

I also noticed that a Serial.print("-"); in the loop() (with only corsair active, all display code turned off) caused a similar situation.

Display uses SPI. But so far I only could get it to work on sofware SPI. Hardware SPI seems to use SPI0 and the display is on SPI1.

I also noticed a warning on the corsair build that it uses software SPI (actually from FastLed lib). So there are 2 software SPI's running at the same time? Is that even possible? At the same time? Can it be somehow conflicting on the internals of the Pico? Wouldn't it be better to have both the display and the corsair on (seperate or the same?) hardware SPI?

Also the problem experienced with serial output may hint towards an interupt problem in the corsair lib? Anything sharing with serial output? Serial.print is working very irreliable. At least the prints in setup() are not outputted. Sometimes I have output. But I also got a situation with a reproducable lock-up. My guess is that this is related.

Hope you can give me some details on how CorsairLightningProtocol internally works (Maybe something conflicting with USB / serial) and may be conflicting the working of the Adafruit ST7789 library. I have seen an Arduino project combining a SPI display with fastled. That is why I am posting this here (and because the serial output problem seems related).

My goal: I want to use the display and it's buttons to control the lightning settings inside. Also show a color picker to select a color and select different modes of operations. So far I used the HSV value (range) of the last led to switch modes. But I need to open iCue for that and it is a little hard to select the right value. So the display + buttons will help greatly and also in hardware mode, I can do much more.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.