Made ground pin explicitly optional

This commit is contained in:
David Madison 2016-12-21 11:01:46 -05:00
parent fc97f13a26
commit a20ca0e108
1 changed files with 7 additions and 3 deletions

View File

@ -5,9 +5,10 @@
#define NUM_LEDS 80 // strip length
#define LED_PIN 6 // Arduino data output pin
#define GROUND_PIN 10 // additional grounding pin (optional)
#define BRIGHTNESS 255 // maximum brightness
#define SPEED 115200 // serial port speed, max available
//#define GROUND_PIN 10 // additional grounding pin (optional)
//#define CALIBRATE // uncomment to set calibration mode
// If no serial data is received for a while, the LEDs are shut off
@ -41,8 +42,11 @@ static const uint8_t magic[] = {
void setup()
{
#ifdef GROUND_PIN
pinMode(GROUND_PIN, OUTPUT);
digitalWrite(GROUND_PIN, LOW);
#endif
FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS);
// Dirty trick: the circular buffer for serial data is 256 bytes,