Hi there -- I notice a couple of mentions about using Hardware SPI for controlling LED Strips, and in the Genesis Poi code, there's a comment, "Ideally you use hardware SPI as it's much faster, though limited to specific pins."
Which pins should I be using to control Dotstar LED strips using a pro trinket? I've standardized in my projects on using pin 3 for a button switch because it's an "interrupt," pin 4 for the data pin, and pin 5 for the clock pin.
Is there a better practice for assigning pins to the LED strip?
Thanks!
Hardware SPI on Pro Trinket for Dotstars
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: Hardware SPI on Pro Trinket for Dotstars
Have a look at the strandtest example. It shows how to use either software or hardware SPI to control the strip:
So, comment out the first section, and uncomment the hardware spi section. Use pin 11 for data and pin 13 for clock.
Code: Select all
// Here's how to control the LEDs from any two pins:
#define DATAPIN 4
#define CLOCKPIN 5
Adafruit_DotStar strip = Adafruit_DotStar(NUMPIXELS, DATAPIN, CLOCKPIN);
// Hardware SPI is a little faster, but must be wired to specific pins
// (Arduino Uno = pin 11 for data, 13 for clock, other boards are different).
//Adafruit_DotStar strip = Adafruit_DotStar(NUMPIXELS);
Please be positive and constructive with your questions and comments.