Hello,
I am an Arduino beginner and have tried to do it by myself. Unfortunately it does not work.
I would like my Demo LED effect to turn on after 3 minutes, but it does not turn on. Therefore I am looking for some help. Could anybody please help me and say where the error is in my sketch.
#include <Adafruit_NeoPixel.h>
#include <TimerOne.h>
#define PINR 6
int led_ring = 60; // Leds (Ring)
Adafruit_NeoPixel ring = Adafruit_NeoPixel(led_ring, PINR, NEO_GRB + NEO_KHZ800);
boolean Demo = false;
int command = 0 ;
uint32_t c;
int all_x_minut=3; //
void setup()
{
ring.begin();
ring.show();
ring.setBrightness(75);
Serial.begin(9600);
Timer1.initialize(all_x_minut*60000);
Timer1.attachInterrupt(Demostart);
}
// ************** Programm ********************
void loop()
{
if (Serial.available() > 0)
{
Timer1.initialize(all_x_minut*60000);
Demo == true;
command = Serial.read();
{
}
}
if (Demo == true)
{
Demomodus();
}
}
// *************** Funktionen ********************
void rainbowCycle(uint8_t wait)
{
uint16_t i, j;
for(j=0; j<256*1; j++) { // 5 cycles of all colors on wheel
for(i=0; i< ring.numPixels(); i++)
{
ring.setPixelColor(i, Wheel(((i * 256 / ring.numPixels()) + j) & 255));
}
ring.show();
delay(wait);
}
}
uint32_t Wheel(byte WheelPos)
{
WheelPos = 255 - WheelPos;
if(WheelPos < 85)
{
return ring.Color(255 - WheelPos * 3, 0, WheelPos * 3);
}
if(WheelPos < 170)
{
WheelPos -= 85;
return ring.Color(0, WheelPos * 3, 255 - WheelPos * 3);
}
WheelPos -= 170;
return ring.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}
void Demomodus()
{
rainbowCycle(55);
}
void Demostart()
{
Demo == true;
}
Thank you in advance and kind regards!