Skip to content

Commit

Permalink
Merge pull request #18 from dmadison/clock-pin
Browse files Browse the repository at this point in the history
Clock Pin Support (4-Wire LEDs)
  • Loading branch information
dmadison authored Oct 18, 2018
2 parents a56f4c7 + f2a4031 commit fece9c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Arduino/LEDstream_FastLED/LEDstream_FastLED.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@
static const uint16_t
Num_Leds = 80; // strip length
static const uint8_t
Led_Pin = 6, // Arduino data output pin
Brightness = 255; // maximum brightness

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

// --- Serial Settings
static const unsigned long
Expand Down Expand Up @@ -122,7 +123,12 @@ void setup(){
pinMode(DEBUG_FPS, OUTPUT);
#endif

FastLED.addLeds<LED_TYPE, Led_Pin, COLOR_ORDER>(leds, Num_Leds);
#ifdef PIN_CLOCK
FastLED.addLeds<LED_TYPE, PIN_DATA, PIN_CLOCK, COLOR_ORDER>(leds, Num_Leds);
#else
FastLED.addLeds<LED_TYPE, PIN_DATA, COLOR_ORDER>(leds, Num_Leds);
#endif

FastLED.setBrightness(Brightness);

#ifdef CLEAR_ON_START
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Open the LEDstream_FastLED file in the Arduino IDE and customize the settings at
- LED data pin
- LED type

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.

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).

## Additional Settings
Expand Down

0 comments on commit fece9c9

Please sign in to comment.