I'm trying to make all of the lights in the "wave" effect in wave and red in red. The wave works, but when I add the red, I get this error: exit status 1 Error compiling for board Arduino Nano.
Heres my code:
#include "FastLED.h"
#define PIN 3
#define NUM_LEDS 33
CRGBArray<NUM_LEDS> leds;
uint8_t hue[NUM_LEDS];
void setup() {
FastLED.addLeds<NEOPIXEL, PIN>(leds, NUM_LEDS);
}
#define Wave {\
for (int i = 0; i < NUM_LEDS; i++)\
{\
hue[i] = 255 / NUM_LEDS * i;\
}\
for (int i = 0; i < NUM_LEDS; i++)\
{\
leds[i] = CHSV(hue[i]++, 255, 255); //Color, saturation, Brightness\
}\
FastLED.show();\
delay(2.5);\
}
#define Red {\
for (int i = 0; i < NUM_LEDS; i++)\
{\
leds[i] = CRGB(255, 0, 0); \
FastLED.show();\
}\
}
Void loop ()
{
Wave;
//Red;
}
And here's the error I'm getting:
Output :
Arduino: 1.8.4 (Windows 10), Board: "Arduino Nano, ATmega328P"
Detecting libraries used...
In file included from C:\Users\ajgri\OneDrive\Documents\Arduino\Wave\Wave.ino:1:0:
C:\Users\ajgri\OneDrive\Documents\Arduino\libraries\FastLED-master/FastLED.h:17:21: note: #pragma message: FastLED version 3.001.008
# pragma message "FastLED version 3.001.008"
^
Compiling libraries...
Compiling library "FastLED-master"
Compiling core...
Using precompiled core
Linking everything together...
uino_avr_nano_cpu_atmega328_4af8848f33f1c75e6ecebe4bd5d56783.a" "-LC:\Users\ajgri\AppData\Local\Temp\arduino_build_534077" -lm
C:\Users\ajgri\AppData\Local\Temp\ccP8DvkN.ltrans0.ltrans.o: In function `main':
C:\Users\ajgri\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\cores\arduino/main.cpp:46: undefined reference to `loop'
collect2.exe: error: ld returned 1 exit status
Using library FastLED-master at version 3.1.6 in folder: C:\Users\ajgri\OneDrive\Documents\Arduino\libraries\FastLED-master
exit status 1
Error compiling for board Arduino Nano.