Expected primary-expression before 'void' please help

,,
as above

Ok, i placed void at the beginning of the line but still the error message “expected primary-expression before ‘void’ ” appears, because it doesn’t appear at the color wipe line but at the bottom at ‘void theaterChaseRainbow’

Btw I really appreciate you all trying to help me and i try you’r suggestions every time just as it is described by you but it doesn’t work.


This is what you told me to do, right? @cherk

[code]
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#define LED_PIN    6
#define LED_COUNT 60
Adafruit_NeoPixel strip(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);
#define PIN        6
#define NUMPIXELS 60
Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
int taster = 7;
int tasterstatus = 0;
#define DELAYVAL 500
#define colorWipe             
#define reverseColorWipe      
#define theaterChase          
#define rainbow               
#define theaterChaseRainbow   


void setup() {
#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
  clock_prescale_set(clock_div_1);
#endif

  delay(180000);

  strip.begin();
  strip.show();
  strip.setBrightness(50);

  pinMode(taster, INPUT);

}



void loop() {

  tasterstatus = digitalRead(taster);
  if (tasterstatus == HIGH)
  {
    pixels.clear();
    for (int i = 0; i < NUMPIXELS; i++) {

      pixels.setPixelColor(i, pixels.Color(0, 150, 0));

      pixels.show();
      delay(DELAYVAL);
    }
  }
  else
  {

    colorWipe(strip.Color         (255,   0,   0), 50);
    reverseColorWipe(strip.Color  (  0, 255,   0), 50);
    colorWipe(strip.Color         (  0,   0, 255), 50);

    theaterChase(strip.Color(127, 127, 127), 50);
    theaterChase(strip.Color(127,   0,   0), 50);
    theaterChase(strip.Color(  0,   0, 127), 50);

    rainbow(10);
    theaterChaseRainbow(50);
  }
}    //    <<<<< here is the missing closing bracket
  void colorWipe(uint32_t color, int wait) {
    for (int i = 0; i < strip.numPixels(); i++) {
      strip.setPixelColor(i, color);
      strip.show();
      delay(wait);
    }
  }

  void reverseColorWipe(uint32_t c, uint8_t wait) {
    for (int16_t i = (strip.numPixels() - 1); i >= 0; i--) {
      strip.setPixelColor(i, c);
      strip.show();
      delay(wait);
    }
  }


  void theaterChase(uint32_t color, int wait) {
    for (int a = 0; a < 10; a++) {
      for (int b = 0; b < 3; b++) {
        strip.clear();
        for (int c = b; c < strip.numPixels(); c += 3) {
          strip.setPixelColor(c, color);
        }
        strip.show();
        delay(wait);
      }
    }
  }

  void rainbow(int wait) {
    for (long firstPixelHue = 0; firstPixelHue < 5 * 65536; firstPixelHue += 256) {
      for (int i = 0; i < strip.numPixels(); i++) {
        int pixelHue = firstPixelHue + (i * 65536L / strip.numPixels());
        strip.setPixelColor(i, strip.gamma32(strip.ColorHSV(pixelHue)));
      }
      strip.show();
      delay(wait);
    }
  }

  void theaterChaseRainbow(int wait) {
    int firstPixelHue = 0;
    for (int a = 0; a < 30; a++) {
      for (int b = 0; b < 3; b++) {
        strip.clear();
        for (int c = b; c < strip.numPixels(); c += 3) {
          int      hue   = firstPixelHue + c * 65536L / strip.numPixels();
          uint32_t color = strip.gamma32(strip.ColorHSV(hue));
          strip.setPixelColor(c, color);
        }
        strip.show();
        delay(wait);
        firstPixelHue += 65536 / 90;
      }
    }
  }
}
[/code]


I just pasted your code and this still appears…

I’ll just stick to my old code without the “taster” because everything is the SAME except the part between ‘else’ and the ‘void loop’

It’s literally the only thing i changed and it just keeps spamming me with error messages.

Hope you all have a nice day and can help others with their problems <3

But not with the code you posted otherwise the functions would all end where they should with a }

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.