Expected unqualified-id before 'volatile'

Keep getting the following error message:

union
exit status 1
expected unqualified-id before 'volatile'

Here is my code:

#define LED_PIN               2
#define LEDS_PER_SEGMENT      14
#define SEGMENTS              12
#define BRIGHTNESS            200
#define NUM_LEDS              LEDS_PER_SEGMENT * SEGMENTS
#define NUM_LEDS_WITH_SAFETY  NUM_LEDS + 1

OCR0B source1[NUM_LEDS_WITH_SAFETY];
OCR0B source2[NUM_LEDS_WITH_SAFETY];
OCR0B output[NUM_LEDS_WITH_SAFETY];

uint8_t blendAmount = 0;
uint8_t patternCounter = 0;
uint8_t source1Pattern = 0;
uint8_t source2Pattern = 1;
bool useSource1 = false;

void setup() {
  FastLED.addLeds<WS2812B, LED_PIN, GRB>(output, NUM_LEDS_WITH_SAFETY);
  FastLED.setBrightness(BRIGHTNESS);
  Serial.begin(57600);
}

void loop() {
  EVERY_N_MILLISECONDS(10) {
    blend(source1, source2, output, NUM_LEDS, blendAmount);   // Blend between the two sources

    if (useSource1) {
      if (blendAmount < 255) blendAmount++;                   // Blend 'up' to source 2
    } else {
      if (blendAmount > 0) blendAmount--;                     // Blend 'down' to source 1
    }
  }

  EVERY_N_SECONDS(8) {
    nextPattern();
  }

  runPattern(source1Pattern, source1);                  // Run both patterns simultaneously
  runPattern(source2Pattern, source2);
  
  FastLED.show();
}

void nextPattern() {
  patternCounter = (patternCounter + 1) % 5;

  if (useSource1) source1Pattern = patternCounter;
  else source2Pattern = patternCounter;

  useSource1 = !useSource1;
}

void runPattern(uint8_t pattern, CRGB *LEDarray) {
  switch (pattern) {
    case 0:
      rainbowComet(LEDarray);
      break;
    case 1:
      prettyNoise(LEDarray);
      break;
    case 2:
      randomStar(LEDarray);
      break;
    case 3:
      fillRainbow(LEDarray);
      break;
    case 4:
      pixels(LEDarray);
      break;
  }
}

uint8_t xyz(uint8_t x, uint8_t y, uint8_t z) {

  /* The coordinates of the edges run from 0 - 15. Each edge only has 14 'real' pixels,
   * so there are only LEDs from 1 - 14. The vertices (corners) are missing.
   * If one of these vertices is requested, return a safe pixel that is not displayed.
   * We do the same for coordinates that are inside the cube i.e. not on an edge.
   */
  
  uint8_t lps = LEDS_PER_SEGMENT;
  uint8_t safePx = NUM_LEDS;

  if ((x == 0 || x == lps + 1) && (y == 0 || y == lps + 1) && (z == 0 || z == lps + 1)) return safePx;

  // z-direction edges
  if (x == 0        && y == 0)        return (8 * lps)  - z;      // Seg 7
  if (x == 0        && y == lps + 1)  return (12 * lps) - z;      // Seg 11
  if (x == lps + 1  && y == 0)        return (3 * lps)  + z - 1;  // Seg 3
  if (x == lps + 1  && y == lps + 1)  return (9 * lps)  + z - 1;  // Seg 9

  // y-direction edges
  if (x == 0        && z == 0)        return y - 1;               // Seg 0
  if (x == 0        && z == lps + 1)  return (7 * lps)  - y;      // Seg 6
  if (x == lps + 1  && z == 0)        return (3 * lps)  - y;      // Seg 2
  if (x == lps + 1  && z == lps + 1)  return (4 * lps)  + y - 1;  // Seg 4

  // x-direction edges
  if (y == 0        && z == 0)        return (8 * lps)  + x - 1;  // Seg 8
  if (y == 0        && z == lps + 1)  return (11 * lps) - x;      // Seg 10
  if (y == lps + 1  && z == 0)        return lps        + x - 1;  // Seg 1
  if (y == lps + 1  && z == lps + 1)  return (6 * lps)  - x;      // Seg 5

  // If none of the above, we have an invalid coordinate
  return safePx;
}

//------------ Patterns below ------------//

void pixels(CRGB *LEDarray) {
  static uint8_t pos = 0;
  static uint8_t a = 0;
  static uint8_t b = 0;

  // Fill all pixels and blend them together
  for (int c = 0; c <= LEDS_PER_SEGMENT + 1; c++) {
    LEDarray[xyz(a,b,c)] = blend(LEDarray[xyz(a,b,c)], CRGB::Orange, 128);
    LEDarray[xyz(a,c,b)] = blend(LEDarray[xyz(a,c,b)], CRGB::Magenta, 128);
    LEDarray[xyz(c,a,b)] = blend(LEDarray[xyz(c,a,b)], CRGB::Blue, 128);
  }

  EVERY_N_MILLISECONDS(33) {    
    // Coordinates moving around a square
    if(pos < 15) a++;
    else if (pos <= (LEDS_PER_SEGMENT * 2) + 1) b++;
    else if (pos <= (LEDS_PER_SEGMENT * 3) + 2) a--;
    else b--;

    // Start again one we reach the end of the square
    pos = (pos + 1) % ((LEDS_PER_SEGMENT + 1) * 4);
  }

  fadeToBlackBy(LEDarray, NUM_LEDS, 10);
  
}

void fillRainbow(CRGB *LEDarray) {
  static uint8_t pos = 0;
  
  uint8_t noise = inoise8(millis()/5);
  fill_rainbow(LEDarray, LEDS_PER_SEGMENT, noise, 10);

  // Copy to other segments
  for (int i = 0; i < SEGMENTS; i++) {
    memmove8(&LEDarray[LEDS_PER_SEGMENT * i], &LEDarray[0], LEDS_PER_SEGMENT * sizeof(CRGB));
  }

  // White dots moving up and down vertical pillars
  LEDarray[xyz(0, 0, LEDS_PER_SEGMENT - pos)] = CRGB::White;
  LEDarray[xyz(0, LEDS_PER_SEGMENT + 1, pos)] = CRGB::White;
  LEDarray[xyz(LEDS_PER_SEGMENT + 1, LEDS_PER_SEGMENT + 1, LEDS_PER_SEGMENT - pos)] = CRGB::White;
  LEDarray[xyz(LEDS_PER_SEGMENT + 1, 0, pos)] = CRGB::White;

  EVERY_N_MILLISECONDS(20) {
    pos = (pos + 1) % LEDS_PER_SEGMENT;
  }
}

void rainbowComet(OCRGB *LEDarray) {
  static uint8_t easeOutVal = 0;
  static uint8_t easeInVal  = 0;

  // Make pattern appear over two segments
  uint8_t ledsPerSegment = LEDS_PER_SEGMENT * 2;
  uint8_t segments = SEGMENTS / 2;

  easeOutVal = ease8InOutQuad(easeInVal);
  easeInVal++;

  uint8_t pos = lerp8by8(0, ledsPerSegment, easeOutVal);
  uint8_t hue =  map(pos, 0, ledsPerSegment, 0, 230);
  
  LEDarray[pos] = CHSV(hue, 255, 255);
  fadeToBlackBy(LEDarray, ledsPerSegment, 20);

  // Copy to other segments
  for (int i = 0; i < segments; i++) {
    memmove8(&LEDarray[ledsPerSegment * i], &LEDarray[0], ledsPerSegment * sizeof(CRGB));
  }
}

void randomStar(OCRGB *LEDarray) {
  EVERY_N_MILLISECONDS(75) {
    LEDarray[random16(0, NUM_LEDS)] = CRGB::LightGrey;
  }


  for (int i = 0; i < NUM_LEDS; i++) {
    
    // Brightness
    uint8_t bNoise = inoise8(i * 100, millis());
    bNoise = constrain(bNoise, 50, 200);
    bNoise = map(bNoise, 50, 200, 20, 80);

    // Hue
    uint8_t hNoise = inoise8(i * 20, millis() / 5);
    hNoise = constrain(hNoise, 50, 200);
    hNoise = map(hNoise, 50, 200, 160, 192);
    
    if (LEDarray[i].g == 0) {
      LEDarray[i] = CHSV(hNoise, 255, bNoise);
    }
  }
  
  fadeToBlackBy(LEDarray, NUM_LEDS, 5);
}


void prettyNoise(OCRGB *LEDarray) {
  fill_noise16 (LEDarray, NUM_LEDS, 1, 0, 100, 1, 1, 50, millis() / 3, 5);
}
option enabled in File -> Preferences.

Error Message:

Arduino: 1.8.13 (Windows 10), Board: "Arduino Uno"





















C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\achavez2021\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10813 -build-path C:\Users\ACHAVE~1\AppData\Local\Temp\arduino_build_24814 -warnings=none -build-cache C:\Users\ACHAVE~1\AppData\Local\Temp\arduino_cache_847170 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\achavez2021\Desktop\sketch_jun03a\sketch_jun03a.ino

C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\achavez2021\Documents\Arduino\libraries -fqbn=arduino:avr:uno -ide-version=10813 -build-path C:\Users\ACHAVE~1\AppData\Local\Temp\arduino_build_24814 -warnings=none -build-cache C:\Users\ACHAVE~1\AppData\Local\Temp\arduino_cache_847170 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.arduinoOTA.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Program Files (x86)\Arduino\hardware\tools\avr -verbose C:\Users\achavez2021\Desktop\sketch_jun03a\sketch_jun03a.ino

Using board 'uno' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr

Using core 'arduino' from platform in folder: C:\Program Files (x86)\Arduino\hardware\arduino\avr

Detecting libraries used...

"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "C:\\Users\\ACHAVE~1\\AppData\\Local\\Temp\\arduino_build_24814\\sketch\\sketch_jun03a.ino.cpp" -o nul -DARDUINO_LIB_DISCOVERY_PHASE

Generating function prototypes...

"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "C:\\Users\\ACHAVE~1\\AppData\\Local\\Temp\\arduino_build_24814\\sketch\\sketch_jun03a.ino.cpp" -o "C:\\Users\\ACHAVE~1\\AppData\\Local\\Temp\\arduino_build_24814\\preproc\\ctags_target_for_gcc_minus_e.cpp" -DARDUINO_LIB_DISCOVERY_PHASE

"C:\\Program Files (x86)\\Arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\ACHAVE~1\\AppData\\Local\\Temp\\arduino_build_24814\\preproc\\ctags_target_for_gcc_minus_e.cpp"

Compiling sketch...

"C:\\Program Files (x86)\\Arduino\\hardware\\tools\\avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10813 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\cores\\arduino" "-IC:\\Program Files (x86)\\Arduino\\hardware\\arduino\\avr\\variants\\standard" "C:\\Users\\ACHAVE~1\\AppData\\Local\\Temp\\arduino_build_24814\\sketch\\sketch_jun03a.ino.cpp" -o "C:\\Users\\ACHAVE~1\\AppData\\Local\\Temp\\arduino_build_24814\\sketch\\sketch_jun03a.ino.cpp.o"

In file included from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\io.h:99:0,

                 from c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:90,

                 from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28,

                 from C:\Users\ACHAVE~1\AppData\Local\Temp\arduino_build_24814\sketch\sketch_jun03a.ino.cpp:1:

sketch_jun03a:8:1: error: expected unqualified-id before 'volatile'

 OCR0B source1[NUM_LEDS_WITH_SAFETY];

 ^

sketch_jun03a:8:1: error: expected ')' before 'volatile'

sketch_jun03a:8:1: error: expected ')' before 'volatile'

sketch_jun03a:9:1: error: expected unqualified-id before 'volatile'

 OCR0B source2[NUM_LEDS_WITH_SAFETY];

 ^

sketch_jun03a:9:1: error: expected ')' before 'volatile'

sketch_jun03a:9:1: error: expected ')' before 'volatile'

sketch_jun03a:10:1: error: expected unqualified-id before 'volatile'

 OCR0B output[NUM_LEDS_WITH_SAFETY];

 ^

sketch_jun03a:10:1: error: expected ')' before 'volatile'

sketch_jun03a:10:1: error: expected ')' before 'volatile'

sketch_jun03a:54:34: error: 'CRGB' has not been declared

 void runPattern(uint8_t pattern, CRGB *LEDarray) {

                                  ^~~~

sketch_jun03a:111:13: error: variable or field 'pixels' declared void

 void pixels(CRGB *LEDarray) {

             ^~~~

sketch_jun03a:111:13: error: 'CRGB' was not declared in this scope

C:\Users\achavez2021\Desktop\sketch_jun03a\sketch_jun03a.ino:111:13: note: suggested alternative: 'OCR0B'

 void pixels(CRGB *LEDarray) {

             ^~~~

             OCR0B

sketch_jun03a:111:19: error: 'LEDarray' was not declared in this scope

 void pixels(CRGB *LEDarray) {

                   ^~~~~~~~

sketch_jun03a:138:18: error: variable or field 'fillRainbow' declared void

 void fillRainbow(CRGB *LEDarray) {

                  ^~~~

sketch_jun03a:138:18: error: 'CRGB' was not declared in this scope

C:\Users\achavez2021\Desktop\sketch_jun03a\sketch_jun03a.ino:138:18: note: suggested alternative: 'OCR0B'

 void fillRainbow(CRGB *LEDarray) {

                  ^~~~

                  OCR0B

sketch_jun03a:138:24: error: 'LEDarray' was not declared in this scope

 void fillRainbow(CRGB *LEDarray) {

                        ^~~~~~~~

sketch_jun03a:160:19: error: variable or field 'rainbowComet' declared void

 void rainbowComet(OCRGB *LEDarray) {

                   ^~~~~

sketch_jun03a:160:19: error: 'OCRGB' was not declared in this scope

C:\Users\achavez2021\Desktop\sketch_jun03a\sketch_jun03a.ino:160:19: note: suggested alternative: 'OCR0B'

 void rainbowComet(OCRGB *LEDarray) {

                   ^~~~~

                   OCR0B

sketch_jun03a:160:26: error: 'LEDarray' was not declared in this scope

 void rainbowComet(OCRGB *LEDarray) {

                          ^~~~~~~~

sketch_jun03a:183:17: error: variable or field 'randomStar' declared void

 void randomStar(OCRGB *LEDarray) {

                 ^~~~~

sketch_jun03a:183:17: error: 'OCRGB' was not declared in this scope

C:\Users\achavez2021\Desktop\sketch_jun03a\sketch_jun03a.ino:183:17: note: suggested alternative: 'OCR0B'

 void randomStar(OCRGB *LEDarray) {

                 ^~~~~

                 OCR0B

sketch_jun03a:183:24: error: 'LEDarray' was not declared in this scope

 void randomStar(OCRGB *LEDarray) {

                        ^~~~~~~~

sketch_jun03a:210:18: error: variable or field 'prettyNoise' declared void

 void prettyNoise(OCRGB *LEDarray) {

                  ^~~~~

sketch_jun03a:210:18: error: 'OCRGB' was not declared in this scope

C:\Users\achavez2021\Desktop\sketch_jun03a\sketch_jun03a.ino:210:18: note: suggested alternative: 'OCR0B'

 void prettyNoise(OCRGB *LEDarray) {

                  ^~~~~

                  OCR0B

sketch_jun03a:210:25: error: 'LEDarray' was not declared in this scope

 void prettyNoise(OCRGB *LEDarray) {

                         ^~~~~~~~

C:\Users\achavez2021\Desktop\sketch_jun03a\sketch_jun03a.ino: In function 'void setup()':

sketch_jun03a:19:3: error: 'FastLED' was not declared in this scope

   FastLED.addLeds<WS2812B, LED_PIN, GRB>(output, NUM_LEDS_WITH_SAFETY);

   ^~~~~~~

sketch_jun03a:19:19: error: 'WS2812B' was not declared in this scope

   FastLED.addLeds<WS2812B, LED_PIN, GRB>(output, NUM_LEDS_WITH_SAFETY);

                   ^~~~~~~

sketch_jun03a:19:37: error: 'GRB' was not declared in this scope

   FastLED.addLeds<WS2812B, LED_PIN, GRB>(output, NUM_LEDS_WITH_SAFETY);

                                     ^~~

C:\Users\achavez2021\Desktop\sketch_jun03a\sketch_jun03a.ino:19:37: note: suggested alternative: 'DDRB'

   FastLED.addLeds<WS2812B, LED_PIN, GRB>(output, NUM_LEDS_WITH_SAFETY);

                                     ^~~

                                     DDRB

sketch_jun03a:19:42: error: 'output' was not declared in this scope

   FastLED.addLeds<WS2812B, LED_PIN, GRB>(output, NUM_LEDS_WITH_SAFETY);

                                          ^~~~~~

C:\Users\achavez2021\Desktop\sketch_jun03a\sketch_jun03a.ino: In function 'void loop()':

sketch_jun03a:25:3: error: 'EVERY_N_MILLISECONDS' was not declared in this scope

   EVERY_N_MILLISECONDS(10) {

   ^~~~~~~~~~~~~~~~~~~~

sketch_jun03a:35:3: error: 'EVERY_N_SECONDS' was not declared in this scope

   EVERY_N_SECONDS(8) {

   ^~~~~~~~~~~~~~~

sketch_jun03a:39:30: error: 'source1' was not declared in this scope

   runPattern(source1Pattern, source1);                  // Run both patterns simultaneously

                              ^~~~~~~

C:\Users\achavez2021\Desktop\sketch_jun03a\sketch_jun03a.ino:39:30: note: suggested alternative: 'useSource1'

   runPattern(source1Pattern, source1);                  // Run both patterns simultaneously

                              ^~~~~~~

                              useSource1

sketch_jun03a:40:30: error: 'source2' was not declared in this scope

   runPattern(source2Pattern, source2);

                              ^~~~~~~

C:\Users\achavez2021\Desktop\sketch_jun03a\sketch_jun03a.ino:40:30: note: suggested alternative: 'useSource1'

   runPattern(source2Pattern, source2);

                              ^~~~~~~

                              useSource1

sketch_jun03a:42:3: error: 'FastLED' was not declared in this scope

   FastLED.show();

   ^~~~~~~

C:\Users\achavez2021\Desktop\sketch_jun03a\sketch_jun03a.ino: At global scope:

sketch_jun03a:54:34: error: 'CRGB' has not been declared

 void runPattern(uint8_t pattern, CRGB *LEDarray) {

                                  ^~~~

C:\Users\achavez2021\Desktop\sketch_jun03a\sketch_jun03a.ino: In function 'void runPattern(uint8_t, int*)':

sketch_jun03a:57:7: error: 'rainbowComet' was not declared in this scope

       rainbowComet(LEDarray);

       ^~~~~~~~~~~~

sketch_jun03a:60:7: error: 'prettyNoise' was not declared in this scope

       prettyNoise(LEDarray);

       ^~~~~~~~~~~

sketch_jun03a:63:7: error: 'randomStar' was not declared in this scope

       randomStar(LEDarray);

       ^~~~~~~~~~

C:\Users\achavez2021\Desktop\sketch_jun03a\sketch_jun03a.ino:63:7: note: suggested alternative: 'randomSeed'

       randomStar(LEDarray);

       ^~~~~~~~~~

       randomSeed

sketch_jun03a:66:7: error: 'fillRainbow' was not declared in this scope

       fillRainbow(LEDarray);

       ^~~~~~~~~~~

sketch_jun03a:69:7: error: 'pixels' was not declared in this scope

       pixels(LEDarray);

       ^~~~~~

C:\Users\achavez2021\Desktop\sketch_jun03a\sketch_jun03a.ino:69:7: note: suggested alternative: 'yield'

       pixels(LEDarray);

       ^~~~~~

       yield

C:\Users\achavez2021\Desktop\sketch_jun03a\sketch_jun03a.ino: At global scope:

sketch_jun03a:111:13: error: variable or field 'pixels' declared void

 void pixels(CRGB *LEDarray) {

             ^~~~

sketch_jun03a:111:13: error: 'CRGB' was not declared in this scope

C:\Users\achavez2021\Desktop\sketch_jun03a\sketch_jun03a.ino:111:13: note: suggested alternative: 'OCR0B'

 void pixels(CRGB *LEDarray) {

             ^~~~

             OCR0B

sketch_jun03a:111:19: error: 'LEDarray' was not declared in this scope

 void pixels(CRGB *LEDarray) {

                   ^~~~~~~~

sketch_jun03a:138:18: error: variable or field 'fillRainbow' declared void

 void fillRainbow(CRGB *LEDarray) {

                  ^~~~

sketch_jun03a:138:18: error: 'CRGB' was not declared in this scope

C:\Users\achavez2021\Desktop\sketch_jun03a\sketch_jun03a.ino:138:18: note: suggested alternative: 'OCR0B'

 void fillRainbow(CRGB *LEDarray) {

                  ^~~~

                  OCR0B

sketch_jun03a:138:24: error: 'LEDarray' was not declared in this scope

 void fillRainbow(CRGB *LEDarray) {

                        ^~~~~~~~

sketch_jun03a:160:19: error: variable or field 'rainbowComet' declared void

 void rainbowComet(OCRGB *LEDarray) {

                   ^~~~~

sketch_jun03a:160:19: error: 'OCRGB' was not declared in this scope

C:\Users\achavez2021\Desktop\sketch_jun03a\sketch_jun03a.ino:160:19: note: suggested alternative: 'OCR0B'

 void rainbowComet(OCRGB *LEDarray) {

                   ^~~~~

                   OCR0B

sketch_jun03a:160:26: error: 'LEDarray' was not declared in this scope

 void rainbowComet(OCRGB *LEDarray) {

                          ^~~~~~~~

sketch_jun03a:183:17: error: variable or field 'randomStar' declared void

 void randomStar(OCRGB *LEDarray) {

                 ^~~~~

sketch_jun03a:183:17: error: 'OCRGB' was not declared in this scope

C:\Users\achavez2021\Desktop\sketch_jun03a\sketch_jun03a.ino:183:17: note: suggested alternative: 'OCR0B'

 void randomStar(OCRGB *LEDarray) {

                 ^~~~~

                 OCR0B

sketch_jun03a:183:24: error: 'LEDarray' was not declared in this scope

 void randomStar(OCRGB *LEDarray) {

                        ^~~~~~~~

sketch_jun03a:210:18: error: variable or field 'prettyNoise' declared void

 void prettyNoise(OCRGB *LEDarray) {

                  ^~~~~

sketch_jun03a:210:18: error: 'OCRGB' was not declared in this scope

C:\Users\achavez2021\Desktop\sketch_jun03a\sketch_jun03a.ino:210:18: note: suggested alternative: 'OCR0B'

 void prettyNoise(OCRGB *LEDarray) {

                  ^~~~~

                  OCR0B

sketch_jun03a:210:25: error: 'LEDarray' was not declared in this scope

 void prettyNoise(OCRGB *LEDarray) {

                         ^~~~~~~~

sketch_jun03a:213:1: error: 'option' does not name a type; did you mean 'union'?

 option enabled in File -> Preferences.

 ^~~~~~

 union

exit status 1

expected unqualified-id before 'volatile'


This one?
That's an AVR register, isn't it?

In future, just post the error message too.

Didn't the compiler also complain about the FastLED references?

  1. I do not know what an AVR register is as this is one of my first times using Arduino.

  2. My bad I will add it

So what do you think an "OCR0B" is?

It must mean something or you wouldn't have arrays of them

Alright well for full context this isn't my project. It is my friends and I'm helping him right now, but I have never used this code before. It is like trying to read German. So yeah I don't know what an AVR is or what it's for.

Looking at his code now I see that he has something called LEDarray that isnt defined. Think that could be the cause of the problem?

So can we get your friend to tell I what s/he thinks an array of registers is supposed to do?

(I've often wondered if German COBOL puts the verb at the end of the statement)

He does not know either

There's at least one missing "#include" at the top of the sketch, but the missing array is the least of your worries.

Ok just added the "#include" and its looking for a file. What file does it need?

Have you tried some of the FastLED library examples?

When is our assignment due to be handed in?

No we havent, I will take a look.

Due next week, June 10th

The original code looks like it may have had some anti-plagiarism traps edited-in.

Still, you've got plenty of time to work on it

Good luck.

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