hi to all. i am doing a program for like group of every 2dots spacing in between 4 black dots chasing each other in a solid color. Please somebody help me out.
marmil
(Marc Miller)
December 27, 2016, 11:43am
2
Here’s three programs which might give you some ideas on how to achieve the pattern you want.
//***************************************************************
// Three moving pixels example
// Uses modulo, %, to make pixel position "loop" around and
// stay in valid pixel range.
//
// Marc Miller, Feb 2015. Updated Jan 2016.
//***************************************************************
#include "FastLED.h"
#define LED_TYPE NEOPIXEL // Strip type: NEOPIXEL, APA102, LPD8806, etc.
#define DATA_PIN 6
//#define CLOCK_PIN 13
#define NUM_LEDS 12
//#define COLOR_ORDER BGR
#define MASTER_BRIGHTNESS 100 // Master brightness (Range is 0-255)
CRGB leds[NUM_LEDS];
int16_t positionRed = 0; // Set initial start position of Red pixel
int16_t positionWhite = 4; // Set initial start position of White pixel
This file has been truncated. show original
//***************************************************************
// If we want a pattern to repeat every 5 pixels then the
// first pixel set to light up would be: 0,5,10,15,20...
// This can be represented by: leds[5 * (x - 1) + 5]
//
// Let's put this into a loop with some variables!
//
//
// Marc Miller, Nov 2015
// May 2020 - replaced all delays with EVERY_N
//***************************************************************
#include "FastLED.h"
#define LED_TYPE LPD8806
#define DATA_PIN 11
#define CLOCK_PIN 13
#define NUM_LEDS 32
#define COLOR_ORDER GRB
#define MASTER_BRIGHTNESS 100
CRGB leds[NUM_LEDS];
This file has been truncated. show original
//***************************************************************
// Marquee fun (v3)
// Pixel position down the strip comes from this formula:
// pos = spacing * (i-1) + spacing
// i starts at 0 and is incremented by +1 up to NUM_LEDS/spacing.
//
// Marc Miller, May 2016
// Updated June 2018 - reordered some stuff and small bug fix.
//***************************************************************
#include "FastLED.h"
#define LED_TYPE LPD8806
#define NUM_LEDS 32
#define COLOR_ORDER GRB
//#define LED_TYPE APA102
//#define NUM_LEDS 39
//#define COLOR_ORDER BGR
#define DATA_PIN 11
This file has been truncated. show original
thank you marc. i will try to use your suggested programs and yesterday i have done 2 group of dots moving and 3 dots moving by using the single dot moving program. I will paste my program.
marmil
(Marc Miller)
December 28, 2016, 3:32pm
4
When sharing code please use http://gist.github.com and then share the link to your code here. Much easier to read the code that way.