Hello! I apologize for being the umpteenth new person to post something like this but I would greatly appreciate some help. I have a Neopixel project for my fishing kayak. I have part of the code working great but getting into some deeper functionality while learning this has me completely stumped.
I am using an arduino Uno to drive one (12 LED) neopixel ring. I am using a “Fade In - Fade to black” style animation to use as a night fishing beacon for my kayak. I have one iteration of the code working but I want to add a function where I have two buttons to press that will basically choose what animation style i want. I want a normal, white color that fades to black effect for just normal fishing and a Red, slightly faster transitioning, Fade in - fade to black effect for if I had an emergency situation. The problem I am having is trying to think of a way to implement the second half into this project where I can choose between modes.
Does anyone have some suggestions? I am horrible at coding, just a basic all around DIY, person so please be patient if I don’t understand something. If someone happens to easily plot a code I can usually understand things much easier than trying to wrap my head around coding logic from the very beginning (my ADHD is horrible for this reason). I am not trying to be a burden on anyone, just trying to understand, much appreciated!
#include <Adafruit_NeoPixel.h>
#define PIN 3
Adafruit_NeoPixel strip = Adafruit_NeoPixel(12, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
strip.begin();
strip.show();
strip.setBrightness(100); //Just for testing purposes so I am not blind
}
void loop() {
uint16_t i, j;
for (j = 0; j < 150; j++) {
for (i = 0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, j, j, j);
}
strip.show();
delay(25);
}
for (j = 150; j > 0; j--) {
for (i = 0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, j, j, j);
}
strip.show();
delay(10);
}
}