I am working on creating a a table top display. There will be items on the table that will need to be illuminated by a NeoPixel Stick - 8 x WS2812 5050 RGB LED with Integrated Drivers. The LED strip will turn on for a 10-15 seconds then off. Then another LED strip will turn on and off to illuminate another product. I would like to have this sequence of lights be triggered with a PIR sensor.
I can't seem to get the code to compile. The error I am getting is;
FFA.ino: In function 'void loop()':
FFA:40: error: 'colorWipe' was not declared in this scope
FFA:46: error: expected initializer before 'for'
FFA:46: error: 'i' was not declared in this scope
FFA:46: error: expected `;' before ')' token
I am using Arduino Uno and I have run a simple test stand on the LED strip and they work great. I just would like to know how to turn them on for a 10-15 seconds and turn on another strip. First I would like to just get one strip to turn on when the PIR sensor detects motion.
Thanks for any help.
Bob
Code: Select all
/* PIR sensor that turns on a Strip of LED neo pixles
*/
# define PIN 3
#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel strip = Adafruit_NeoPixel(8, PIN, NEO_GRB + NEO_KHZ800);
int pirPin = 2;
int led = 3;
void setup() {
pinMode(pirPin, INPUT);
pinMode(led, OUTPUT);
Serial.begin(9600);
strip.begin();
strip.show(); // Initialize all pixels to 'off'
strip.setBrightness(100);
}
void loop() {
if (digitalRead(pirPin) == HIGH)
{
Serial.println("MOVEMENT");
digitalWrite(led, HIGH);
colorWipe(strip.Color(127, 127, 127), 100); // fill the strip with all white
strip.show(); // Initialize all pixels to 'off'
// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait)
for(uint16_t i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, c);
strip.show();
}
}
else
{
strip.show(); // Initialize all pixels to 'off'
Serial.println("NO Movement");
digitalWrite(led, LOW);
delay(500);
}
}