Changed Cylon to run w/o FastLED
This commit is contained in:
+10
-11
@@ -1,6 +1,5 @@
|
||||
//Cylon demo for OctoFLED
|
||||
//Cylon demo for OctoFLED Raw (without FastLED)
|
||||
#include <ObjectFLED.h>
|
||||
#include <FastLED.h>
|
||||
|
||||
// How many leds in your strip?
|
||||
#define NUM_LEDS 32
|
||||
@@ -8,8 +7,8 @@
|
||||
// For led chips like Neopixels, which have a data line, ground, and power, you just
|
||||
// need to define DATA_PIN. Or list of pins for parallel connections to your LED device.
|
||||
uint8_t DATA_PIN[1] = { 17 };
|
||||
// Define the array of leds
|
||||
CRGB leds[NUM_LEDS];
|
||||
// Define the array of leds, 3 bytes per
|
||||
uint8_t leds[NUM_LEDS*3];
|
||||
// Define the display object with 8-pixel serpentine on 8x8 plane
|
||||
ObjectFLED cylon( NUM_LEDS, leds, CORDER_GRB, sizeof(DATA_PIN), DATA_PIN, 8);
|
||||
void setup() {
|
||||
@@ -17,21 +16,21 @@ void setup() {
|
||||
cylon.setBrightness(84);
|
||||
}
|
||||
|
||||
CRGB dotColor = 0xff0000;
|
||||
const uint8_t dotColor[3] = { 0xFF, 0, 0 }; //R, G, B
|
||||
const int delayT = 25;
|
||||
const int fadeAmt = 40;
|
||||
void loop() {
|
||||
for( int i=0; i<NUM_LEDS; i++) {
|
||||
leds[i] = dotColor;
|
||||
for( int i=0; i<NUM_LEDS*3; i+=3) {
|
||||
memcpy(&leds[i], &dotColor, 3);
|
||||
cylon.show();
|
||||
fadeToBlackBy(leds, NUM_LEDS, fadeAmt);
|
||||
fadeToColorBy(leds, NUM_LEDS, 0 ,fadeAmt);
|
||||
delay(delayT);
|
||||
}
|
||||
delay(delayT);
|
||||
for( int i=NUM_LEDS-1; i>=0; i--) {
|
||||
leds[i] = dotColor;
|
||||
for( int i=(NUM_LEDS-1)*3; i>=0; i-=3) {
|
||||
memcpy(&leds[i], &dotColor, 3);
|
||||
cylon.show();
|
||||
fadeToBlackBy(leds, NUM_LEDS, fadeAmt);
|
||||
fadeToColorBy(leds, NUM_LEDS, 0 ,fadeAmt);
|
||||
delay(delayT);
|
||||
}
|
||||
delay(delayT);
|
||||
|
||||
Reference in New Issue
Block a user