Different NEOPIXEL types

Same as #7728 but for 2.0.x,
Lot of cleanup and remove references in whole code to other "LED files" than leds.h. Now will be much easier to add next drivers/libraries. e.g. FastLED. But bad news, currently FastLED is suporting only RGB devices (no RGBW)
This commit is contained in:
Slawomir Ciunczyk
2017-10-05 13:45:36 +02:00
committed by Scott Lahteine
parent b30b55307c
commit a11e6a1022
49 changed files with 646 additions and 300 deletions

View File

@ -1570,14 +1570,20 @@
* Adds the M150 command to set the LED (or LED strip) color.
* If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
* luminance values can be set from 0 to 255.
* For Neopixel LED overall brightness parameters is also available
*
* *** CAUTION ***
* LED Strips require a MOFSET Chip between PWM lines and LEDs,
* as the Arduino cannot handle the current the LEDs will require.
* Failure to follow this precaution can destroy your Arduino!
* Neopixel LED is 5V powered, but linear 5V regulator on Arduino
* cannot handle the current, separate 5V power supply must be used
* *** CAUTION ***
*
* LED type. This options are mutualy exclusive. Uncomment only one.
*
*/
//#define RGB_LED
//#define RGBW_LED
#if ENABLED(RGB_LED) || ENABLED(RGBW_LED)
@ -1588,11 +1594,14 @@
#endif
// Support for Adafruit Neopixel LED driver
//#define NEOPIXEL_RGBW_LED
#if ENABLED(NEOPIXEL_RGBW_LED)
#define NEOPIXEL_PIN 4 // D4 (EXP2-5 on Printrboard)
#define NEOPIXEL_PIXELS 3
//#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup
//#define NEOPIXEL_LED
#if ENABLED(NEOPIXEL_LED)
#define NEOPIXEL_TYPE NEO_GRB // NEO_GRBW / NEO_GRB - four/three channel driver type (definned in Adafruit_NeoPixel.h)
#define NEOPIXEL_PIN 4 // LED driving pin on motherboard 4 => D4 (EXP2-5 on Printrboard) / 30 => PC7 (EXP3-13 on Rumba)
#define NEOPIXEL_PIXELS 30 // Number of LEDs on strip
#define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Comment out for all LEDs to change at once.
#define NEOPIXEL_BRIGHTNESS 255 // Initial brightness 0-255
//#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup
#endif
/**
@ -1606,7 +1615,7 @@
* - Change to green once print has finished
* - Turn off after the print has finished and the user has pushed a button
*/
#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632) || ENABLED(NEOPIXEL_RGBW_LED)
#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632) || ENABLED(NEOPIXEL_LED)
#define PRINTER_EVENT_LEDS
#endif

View File

@ -1570,14 +1570,20 @@
* Adds the M150 command to set the LED (or LED strip) color.
* If pins are PWM capable (e.g., 4, 5, 6, 11) then a range of
* luminance values can be set from 0 to 255.
* For Neopixel LED overall brightness parameters is also available
*
* *** CAUTION ***
* LED Strips require a MOFSET Chip between PWM lines and LEDs,
* as the Arduino cannot handle the current the LEDs will require.
* Failure to follow this precaution can destroy your Arduino!
* Neopixel LED is 5V powered, but linear 5V regulator on Arduino
* cannot handle the current, separate 5V power supply must be used
* *** CAUTION ***
*
* LED type. This options are mutualy exclusive. Uncomment only one.
*
*/
//#define RGB_LED
//#define RGBW_LED
#if ENABLED(RGB_LED) || ENABLED(RGBW_LED)
@ -1588,11 +1594,14 @@
#endif
// Support for Adafruit Neopixel LED driver
//#define NEOPIXEL_RGBW_LED
#if ENABLED(NEOPIXEL_RGBW_LED)
#define NEOPIXEL_PIN 4 // D4 (EXP2-5 on Printrboard)
#define NEOPIXEL_PIXELS 3
//#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup
//#define NEOPIXEL_LED
#if ENABLED(NEOPIXEL_LED)
#define NEOPIXEL_TYPE NEO_GRB // NEO_GRBW / NEO_GRB - four/three channel driver type (definned in Adafruit_NeoPixel.h)
#define NEOPIXEL_PIN 4 // LED driving pin on motherboard 4 => D4 (EXP2-5 on Printrboard) / 30 => PC7 (EXP3-13 on Rumba)
#define NEOPIXEL_PIXELS 30 // Number of LEDs on strip
#define NEOPIXEL_IS_SEQUENTIAL // Sequential display for temperature change - LED by LED. Comment out for all LEDs to change at once.
#define NEOPIXEL_BRIGHTNESS 255 // Initial brightness 0-255
//#define NEOPIXEL_STARTUP_TEST // Cycle through colors at startup
#endif
/**
@ -1606,7 +1615,7 @@
* - Change to green once print has finished
* - Turn off after the print has finished and the user has pushed a button
*/
#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632) || ENABLED(NEOPIXEL_RGBW_LED)
#if ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632) || ENABLED(NEOPIXEL_LED)
#define PRINTER_EVENT_LEDS
#endif