I have a DotStar LED strip that I want to make it blink (e.g., 1 second on, 5 second off in an endless loop).
I tried doing so via the script below but it does not work. Can someone please explain me how to do so?
Script:
#include <Adafruit_DotStar.h>
#include <SPI.h>
#define NUMPIXELS 10
#define DATAPIN 4
#define CLOCKPIN 5
Adafruit_DotStar strip = Adafruit_DotStar(NUMPIXELS, DATAPIN, CLOCKPIN, DOTSTAR_BRG);
void setup()
{
strip.begin();
strip.show();
}
void loop()
{
strip.show();
strip.setBrightness(155);
for (int i=0; i <= 10; i=i+1) {
strip.setPixelColor(i, 255, 255, 255);
}
delay(1000);
strip.setBrightness(0);
delay(5000);
}