Hi Guys (and ladies)!
I'm a complete noob, so please be gentle!
I've been reading and reading, and cannot seem to figure out what I'm missing here.
I'm still in the "copy and paste" phase, so I'm sorry if I have a dumb question here.
I'd really appreciate it if one of you could peek at my code and see if you see any glaring errors.
Thanks oh so much!
The error code is:
exit status 1
'blink' was not declared in this scope
/*Description:
- This project is an Arduino Nano Controlling 60 ws2811 5V pixels. (Led Strip)
- I need the Arduino to have 2 preset scenes which I can toggle with a momentary on Push button.
- By default, when the arduino powers on, the lights will be a rainbow fade from one pixel to the next.
- When I push the button, The lights will turn on Full White.
- When I Push the button again, they will go back to rainbow.
- Switch between Rainbow, and White.
*/
#include <Adafruit_NeoPixel.h>
#ifdef AVR
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif
// Digital IO pin connected to the button. This will be driven with a
// pull-up resistor so the switch pulls the pin to ground momentarily.
// On a high -> low transition the button press logic will execute.
#define BUTTON_PIN 2
#define PIXEL_PIN 6 // Digital IO pin connected to the NeoPixels.
#define PIXEL_COUNT 60 // Number of NeoPixels
// Declare our NeoPixel strip object:
Adafruit_NeoPixel strip(PIXEL_COUNT, PIXEL_PIN, NEO_GRB + NEO_KHZ400);
// Argument 1 = Number of pixels in NeoPixel strip
// Argument 2 = Arduino pin number (most are valid)
// Argument 3 = Pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
// NEO_RGBW Pixels are wired for RGBW bitstream (NeoPixel RGBW products)
volatile byte mode = LOW; // Currently-active animation mode, 0-1
int i;
long firstPixelHue;
void setup() {
pinMode(BUTTON_PIN, INPUT_PULLUP);
strip.begin(); // Initialize NeoPixel strip object (REQUIRED)
strip.show(); // Initialize all pixels to 'off'
attachInterrupt digitalPinToInterrupt(BUTTON_PIN), blink, LOW);
Serial.begin(9600);
}
void loop() {
switch(mode) { // Start the new animation
case 0:
rainbow(); // Rainbow cycle along whole strip
break;
case 1:
colorWipe(strip.Color(255, 255, 255), 50); // white
i=0;
firstPixelHue = 0;
break;
}
}