Skip to content

Commit

Permalink
Fix compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulStoffregen committed Feb 8, 2016
1 parent 6cf7173 commit 312693b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
10 changes: 4 additions & 6 deletions Adafruit_NeoPixel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

// Constructor when length, pin and type are known at compile-time:
Adafruit_NeoPixel::Adafruit_NeoPixel(uint16_t n, uint8_t p, neoPixelType t) :
brightness(0), pixels(NULL), endTime(0), begun(false)
begun(false), brightness(0), pixels(NULL), endTime(0)
{
updateType(t);
updateLength(n);
Expand All @@ -49,11 +49,11 @@ Adafruit_NeoPixel::Adafruit_NeoPixel(uint16_t n, uint8_t p, neoPixelType t) :
// command. If using this constructor, MUST follow up with updateType(),
// updateLength(), etc. to establish the strand type, length and pin number!
Adafruit_NeoPixel::Adafruit_NeoPixel() :
pin(-1), brightness(0), pixels(NULL), endTime(0), begun(false),
numLEDs(0), numBytes(0), rOffset(1), gOffset(0), bOffset(2), wOffset(1)
#ifdef NEO_KHZ400
, is800KHz(true)
is800KHz(true),
#endif
begun(false), numLEDs(0), numBytes(0), pin(-1), brightness(0), pixels(NULL),
rOffset(1), gOffset(0), bOffset(2), wOffset(1), endTime(0)
{
}

Expand Down Expand Up @@ -1111,7 +1111,6 @@ void Adafruit_NeoPixel::show(void) {
// Set the output pin number
void Adafruit_NeoPixel::setPin(uint8_t p) {
if(begun && (pin >= 0)) pinMode(pin, INPUT);
if(p >= 0) {
pin = p;
if(begun) {
pinMode(p, OUTPUT);
Expand All @@ -1121,7 +1120,6 @@ void Adafruit_NeoPixel::setPin(uint8_t p) {
port = portOutputRegister(digitalPinToPort(p));
pinMask = digitalPinToBitMask(p);
#endif
}
}

// Set pixel color from separate R,G,B components:
Expand Down
8 changes: 4 additions & 4 deletions examples/strandtest/strandtest.ino
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,14 @@ void rainbowCycle(uint8_t wait) {
void theaterChase(uint32_t c, uint8_t wait) {
for (int j=0; j<10; j++) { //do 10 cycles of chasing
for (int q=0; q < 3; q++) {
for (int i=0; i < strip.numPixels(); i=i+3) {
for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, c); //turn every third pixel on
}
strip.show();

delay(wait);

for (int i=0; i < strip.numPixels(); i=i+3) {
for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, 0); //turn every third pixel off
}
}
Expand All @@ -104,14 +104,14 @@ void theaterChase(uint32_t c, uint8_t wait) {
void theaterChaseRainbow(uint8_t wait) {
for (int j=0; j < 256; j++) { // cycle all 256 colors in the wheel
for (int q=0; q < 3; q++) {
for (int i=0; i < strip.numPixels(); i=i+3) {
for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, Wheel( (i+j) % 255)); //turn every third pixel on
}
strip.show();

delay(wait);

for (int i=0; i < strip.numPixels(); i=i+3) {
for (uint16_t i=0; i < strip.numPixels(); i=i+3) {
strip.setPixelColor(i+q, 0); //turn every third pixel off
}
}
Expand Down

0 comments on commit 312693b

Please sign in to comment.