Hi
I am trying to run my Teensy 3.6 using both the Teensy Audio board and an Adafruit TLC59711 12 channel SPI RGB LED board. I want to be able to easily pulse the LEDs in sync with the music using the features of the Teensy's great audio system design tool. However I am struggling to get the Adafruit TLC59711 to work properly.
Since I am using the teensy audio shield I cannot use the SPI0 pins or the default SPI1 pins. So I have tried to use the alternative SPI1 pins (eventually I'll use the SPI2 pins on the back) -but it won't work using those pins.
I can get it to work using software SPI -using pins 36 (data) and 35 (clock) but I can't using pins 20 & 21. Here is the code -it's basically the adafruit example but with the pins changed. View attachment RGB.h.
I think part of my problem is that I don't really know how to 'begin' SPI1 or SPI2, also I'm wondering if the Adafruit_TLC59711 library hardcodes for use of SPI0 or software SPI -but I can't check as my coding skills are way too limited.
I have seen that you can use commands such as ' SPI.setMOSI(pin)' to change the default pin to an alternative, and I'm guessing I can use 'SPI1.begin' to start the SPI1 channel. However I don't know where to add them into the code -as I don't understand why the example code doesn't include an SPI.begin line at all? Does the library kick off it's own software SPI channel using the pins that are defined in my code? So it works when I define generic pins (35, 36) but conflicts with the hardware SPI1 when I set it to use those pins?
Also, one further observation -when I upload this code it disables the USB serial. Why would it do that? How do I stop it doing that?
Can anyone point me in the right direction?
I am trying to run my Teensy 3.6 using both the Teensy Audio board and an Adafruit TLC59711 12 channel SPI RGB LED board. I want to be able to easily pulse the LEDs in sync with the music using the features of the Teensy's great audio system design tool. However I am struggling to get the Adafruit TLC59711 to work properly.
Since I am using the teensy audio shield I cannot use the SPI0 pins or the default SPI1 pins. So I have tried to use the alternative SPI1 pins (eventually I'll use the SPI2 pins on the back) -but it won't work using those pins.
I can get it to work using software SPI -using pins 36 (data) and 35 (clock) but I can't using pins 20 & 21. Here is the code -it's basically the adafruit example but with the pins changed. View attachment RGB.h.
I think part of my problem is that I don't really know how to 'begin' SPI1 or SPI2, also I'm wondering if the Adafruit_TLC59711 library hardcodes for use of SPI0 or software SPI -but I can't check as my coding skills are way too limited.
I have seen that you can use commands such as ' SPI.setMOSI(pin)' to change the default pin to an alternative, and I'm guessing I can use 'SPI1.begin' to start the SPI1 channel. However I don't know where to add them into the code -as I don't understand why the example code doesn't include an SPI.begin line at all? Does the library kick off it's own software SPI channel using the pins that are defined in my code? So it works when I define generic pins (35, 36) but conflicts with the hardware SPI1 when I set it to use those pins?
Also, one further observation -when I upload this code it disables the USB serial. Why would it do that? How do I stop it doing that?
Can anyone point me in the right direction?