So what I'm trying to make is essentially a display for some glass art work with an LED to back light the glass.
Currently, I have a code and circuit that run off an arduino nano exactly how I want. How I foresee the finished product is some sort of switch that turns on the arduino, runs the program for a few minutes then turns off. As well, if I press the switch a second time it turns off the program.
My experience with coding is limited but I have a fairly good understanding of circuits. I have found a few bits of code that seem to accomplish what I want, but either I don't understand them or when I modify it into my program it doesn't work.
Any help with this would be greatly appreciated.
Here's the program for the Color phasing RGB
const int red = 11;
const int green = 10;
const int blue = 9;
int r = 255;
int b;
int g;
int t = 250;
void setup() {}
void loop() {
for (/* no initialization */; r>=0, b<255; b++, r--) /*red -> blue*/
{
analogWrite(red, r);
analogWrite(blue, b);
delay(t);
}
for (/* no initialization */; b>=0, g<255; g++, b--) /*blue -> green*/
{
analogWrite(blue, b);
analogWrite(green, g);
delay(t);
}
for (/* no initialization */; g>=0, r<255; r++, g--) /*green -> red*/
{
analogWrite(red, r);
analogWrite(green, g);
delay(t);
}
}