Page 1 of 1
Forum

Welcome to the Tweaking4All community forums!
When participating, please keep the Forum Rules in mind!

Topics for particular software or systems: Start your topic link with the name of the application or system.
For example “MacOS X – Your question“, or “MS Word – Your Tip or Trick“.

Please note that switching to another language when reading a post will not bring you to the same post, in Dutch, as there is no translation for that post!



Compound Expression...
 
Share:
Notifications
Clear all

[Solved] Compound Expression List Warning

2 Posts
2 Users
0 Reactions
2,036 Views
(@garv64)
New Member
Joined: 8 years ago
Posts: 1
Topic starter  

Hi,

I've been trying to combine two lighting effects with my Neopixels and after fixing a few problems with declaring variables in some lines of the code, the IDE gave me a warning message about an expression list being treated as a 'compound expression list' when I attempted to verify the sketch.

Here is my code;

#include <Adafruit_NeoPixel.h>

      #define PIN 6

      #define NUM_LEDS 60 

// Parameter 1 = number of pixels in strip

// Parameter 2 = pin number (most are valid)

// Parameter 3 = pixel type flags, add together as needed:

// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)

// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)

// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)

// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)

Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);

    void setup() {

  strip.begin();

  strip.show(); // Initialize all pixels to 'off'

}

void loop() {

  for(int i=60;i<5;i++) { 

    rainbowCycle(20);

  }

  colorWipe(0xff,0x00,0x00, 50);

  colorWipe(0x00,0xff,0x00, 50);

  colorWipe(0x00,0x00,0xff, 50);

  colorWipe(0xB7,0x00,0xFE, 50);

  colorWipe(0xff,0xff,0x00, 50);

  colorWipe(0xff,0xA5,0x00, 50);

}

void rainbowCycle(int SpeedDelay) {

  byte *c;

  uint16_t i, j;

  for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel

    for(i=0; i< NUM_LEDS; i++) {

      c=Wheel(((i * 256 / NUM_LEDS) + j) & 255);

int setPixel(i, *c, *(c+1), *(c+2));

    }

int showStrip();

    delay(SpeedDelay);

  }

}

byte * Wheel(byte WheelPos) {

  static byte c[3];

  

  if(WheelPos < 85) {

   c[0]=WheelPos * 3;

   c[1]=255 - WheelPos * 3;

   c[2]=0;

  } else if(WheelPos < 170) {

   WheelPos -= 85;

   c[0]=255 - WheelPos * 3;

   c[1]=0;

   c[2]=WheelPos * 3;

  } else {

   WheelPos -= 170;

   c[0]=0;

   c[1]=WheelPos * 3;

   c[2]=255 - WheelPos * 3;

  }

  return c;

}

void colorWipe(byte red, byte green, byte blue, int SpeedDelay) {

  for(uint16_t i=0; i<NUM_LEDS; i++) {

int setPixel(i, red, green, blue);

int showStrip();

      delay(SpeedDelay);

  }

}

Anyone have any ideas where I've gone wrong or if its something small that won't affect the output of the Neopixel strip?

Thanks,

Dan


   
ReplyQuote
 Hans
(@hans)
Famed Member Admin
Joined: 12 years ago
Posts: 2859
 

Hi Dan,

apologies for the late reply.

Could it be that you're running the Arduino IDE on a Window machine? If so: consider upgrading to a newer version. I recall issues like that in the past related to a specific version (forgot which one). This seems to be a bug in the C compiler.


   
ReplyQuote
Share: