Here's the error:
Death_Test:39: error: 'pixels' does not name a type
Death_Test:40: error: 'pixels' does not name a type
Death_Test:41: error: expected constructor, destructor, or type conversion before '(' token
Death_Test:42: error: 'pixels' does not name a type
Death_Test:43: error: 'pixels' does not name a type
Death_Test:44: error: 'pixels' does not name a type
Death_Test:45: error: 'pixels' does not name a type
Death_Test:47: error: expected declaration before '}' token
exit status 1
'pixels' does not name a type
and here's the code i'm working with
Code: Select all
#include <Adafruit_NeoPixel.h>
#define PIN 1
#define NUMPIXELS 20
#define DELAY_MILLIS 30
#define DELAY_MULT 8
#define BRIGHT 60
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
uint8_t myFavoriteColors[][3] = {(242, 90, 255),
(255, 222, 30),
(255, 100, 0),
};
#define FAVCOLORS sizeof myFavoriteColors/3
void setup() {
pixels.begin();
pixels.setBrightness(BRIGHT);
pixels.show();
}
void loop() {
int RColor = random(FAVCOLORS);
}
//sparkling
int p = random(NUMPIXELS); //select a random pixel
pixels.setPixelColor(p, RColor);
pixels.show();
delay(DELAY_MILLIS * random(DELAY_MULT) );
pixels.setPixelColor(p, RColor/10);
pixels.show();
pixels.setPixelColor(p+1, RColor/15);
pixels.show();
}