Skip to content

Commit fece9c9

Browse files
authored
Merge pull request #18 from dmadison/clock-pin
Clock Pin Support (4-Wire LEDs)
2 parents a56f4c7 + f2a4031 commit fece9c9

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

Arduino/LEDstream_FastLED/LEDstream_FastLED.ino

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@
2525
static const uint16_t
2626
Num_Leds = 80; // strip length
2727
static const uint8_t
28-
Led_Pin = 6, // Arduino data output pin
2928
Brightness = 255; // maximum brightness
3029

3130
// --- FastLED Setings
3231
#define LED_TYPE WS2812B // led strip type for FastLED
3332
#define COLOR_ORDER GRB // color order for bitbang
33+
#define PIN_DATA 6 // led data output pin
34+
//#define PIN_CLOCK 7 // led data clock pin (uncomment if you're using a 4-wire LED type)
3435

3536
// --- Serial Settings
3637
static const unsigned long
@@ -122,7 +123,12 @@ void setup(){
122123
pinMode(DEBUG_FPS, OUTPUT);
123124
#endif
124125

125-
FastLED.addLeds<LED_TYPE, Led_Pin, COLOR_ORDER>(leds, Num_Leds);
126+
#ifdef PIN_CLOCK
127+
FastLED.addLeds<LED_TYPE, PIN_DATA, PIN_CLOCK, COLOR_ORDER>(leds, Num_Leds);
128+
#else
129+
FastLED.addLeds<LED_TYPE, PIN_DATA, COLOR_ORDER>(leds, Num_Leds);
130+
#endif
131+
126132
FastLED.setBrightness(Brightness);
127133

128134
#ifdef CLEAR_ON_START

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Open the LEDstream_FastLED file in the Arduino IDE and customize the settings at
2020
- LED data pin
2121
- LED type
2222

23+
If you are using a 4-wire LED chipset like APA102, you will need to uncomment the `PIN_CLOCK` line and set that as well.
24+
2325
Upload to your Arduino and use a corresponding PC application to stream color data. You can get the Processing files from the [main Adalight repository](https://github.com/adafruit/Adalight), though I would recommend using [Patrick Siegler's](https://github.com/psieg/) fork of Lightpacks's Prismatik, which you can find [here](https://github.com/psieg/Lightpack/releases).
2426

2527
## Additional Settings

0 commit comments

Comments
 (0)