Update Pixel.ino

changed nPixels from uint8_t to int to allow for longer pixel strands (library is coded for int, so there is no need to limit to uint8_t in the example).
This commit is contained in:
Gregg 2023-07-24 09:24:58 -05:00
parent a73b206531
commit d6f5612f9f
1 changed files with 6 additions and 6 deletions

View File

@ -72,9 +72,9 @@ struct NeoPixel_RGB : Service::LightBulb { // Addressable single-wire RGB L
Characteristic::Saturation S{0,true};
Characteristic::Brightness V{100,true};
Pixel *pixel;
uint8_t nPixels;
int nPixels;
NeoPixel_RGB(uint8_t pin, uint8_t nPixels) : Service::LightBulb(){
NeoPixel_RGB(uint8_t pin, int nPixels) : Service::LightBulb(){
V.setRange(5,100,1); // sets the range of the Brightness to be from a min of 5%, to a max of 100%, in steps of 1%
pixel=new Pixel(pin); // creates Pixel LED on specified pin
@ -106,9 +106,9 @@ struct NeoPixel_RGBW : Service::LightBulb { // Addressable single-wire RGBW
Characteristic::Brightness V{100,true};
Characteristic::ColorTemperature T{140,true};
Pixel *pixel;
uint8_t nPixels;
int nPixels;
NeoPixel_RGBW(uint8_t pin, uint8_t nPixels) : Service::LightBulb(){
NeoPixel_RGBW(uint8_t pin, int nPixels) : Service::LightBulb(){
V.setRange(5,100,1); // sets the range of the Brightness to be from a min of 5%, to a max of 100%, in steps of 1%
pixel=new Pixel(pin,true); // creates Pixel RGBW LED (second parameter set to true for RGBW) on specified pin
@ -142,9 +142,9 @@ struct DotStar_RGB : Service::LightBulb { // Addressable two-wire RGB LED S
Characteristic::Saturation S{0,true};
Characteristic::Brightness V{100,true};
Dot *pixel;
uint8_t nPixels;
int nPixels;
DotStar_RGB(uint8_t dataPin, uint8_t clockPin, uint8_t nPixels) : Service::LightBulb(){
DotStar_RGB(uint8_t dataPin, uint8_t clockPin, int nPixels) : Service::LightBulb(){
V.setRange(5,100,1); // sets the range of the Brightness to be from a min of 5%, to a max of 100%, in steps of 1%
pixel=new Dot(dataPin,clockPin); // creates Dot LED on specified pins