Hi guys,
So I butchered the code from one of the featured projects on Adafruits website:
"Becky Stern's: Neopixel bracelet".
https://learn.adafruit.com/neopixel-rin ... celet/code
I've got little to no code experience but this code with a little alteration works for me personally.
It gives the two 24xLED's neopixel rings the animation I want.
Only thing I'd still like to add is a potentiometer to adress the speed (delay) in this animation.
So I can speed up and slow down the color change.
Could anyone help me as to how I code the potentiometer (analog input A1) into this code?
Thanks for helping me out on this
The Code is below, I know the "Sine" line is huge, but hey, It does the job....
//Basic sine wave animation for NeoPixel Ring Bangle Bracelet
//by Dano Wall and Becky Stern for Adafruit Industries
#include <Adafruit_NeoPixel.h>
#define PIN 6
Adafruit_NeoPixel strip = Adafruit_NeoPixel(48, PIN, NEO_GRB + NEO_KHZ800);
int sine[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47};
void setup() {
strip.begin();
//strip.setBrightness(90); //adjust brightness here
strip.show(); // Initialize all pixels to 'off'
}
void loop() {
for(int i=0; i<48; i++) {
strip.setPixelColor(sine[i], strip.Color(60, 30, 0)); //change RGB color value here
delay(20);
for (int j=0; j<25; j++){
strip.setPixelColor(sine[(j+i+1)%48], strip.Color(10, 10, 10));
}
strip.show();
}
}