I can animate a reel of dotstars (APA102) on an Arduino using adafruit/Adafruit_DotStar; however, when I try to use the technobly/Particle-DotStar I cannot get it to work (in neither bit-bang nor SPI modes).
I thought initially that the 40ns/V slew rate for the level shifter was interfering; however, I slowed the SPI down by 128 ( SPI_CLOCK_DIV128) and still no joy.
// This #include statement was automatically added by the Particle IDE.
#include <dotstar.h>
// GLOBALS
#define NUMPIXLES 30
#define DEBUG true
String app = "xmas-dot-2020: spi/64";
// not working-- trying bit-bang:
Adafruit_DotStar strip(NUMPIXLES, DOTSTAR_BGR);
// strip(numpix, data, clock)
//Adafruit_DotStar strip(NUMPIXLES, D1, D0);
void testStrip() {
// test primary colors
//strip.fill(strip.Color(255,0,0));
for (int i = 0; i<strip.numPixels(); i++ ) strip.setPixelColor(i, 255,0,0);
strip.show();
delay(5000);
//strip.fill(strip.Color(0,255,0));
for (int i = 0; i<strip.numPixels(); i++ ) strip.setPixelColor(i, 0,255,0);
strip.show();
delay(5000);
//strip.fill(strip.Color(0,0,255));
for (int i = 0; i<strip.numPixels(); i++ ) strip.setPixelColor(i, 0,0,255);
strip.show();
delay(5000);
//strip.fill(strip.Color(255,255,255));
for (int i = 0; i<strip.numPixels(); i++ ) strip.setPixelColor(i, 255,255,255);
strip.show();
delay(5000);
strip.clear();
strip.show();
}
void setup() {
strip.begin();
strip.show();
Particle.variable("app", app);
// 201130: slowing clock down for level-shifter skew rate.
SPI.setClockDivider(SPI_CLOCK_DIV128);
if (DEBUG) {
testStrip();
Particle.publish("log", "Finished test");
}
}
void loop() {
}