I have an project for School and I am nearly at the end. We have to light up 2 normal LEDs and one LED should Blink at the same time. At this Point I did not have any Problems until I wanted to combine this with an Adafruit LED strip. Now I have no clue why I cant let them glow at the same Time. Any help or advice?
//START
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#define LED_PIN(SCL, OUTPUT)
#define LED_COUNT 60
Adafruit_NeoPixel strip(60, SCL,NEO_GRB + NEO_KHZ800);
const int ledPin = 13;
int ledState = LOW;
long previousMillis = 0;
long interval = 475;
void setup() {
pinMode(ledPin, OUTPUT);
#if defined(__AVR_ATtiny85) && (F_CPU == 16000000)
clock_prescale_set(clock_div_1);
#endif
strip.begin();
strip.show();
strip.setBrightness(50);
pinMode(12, OUTPUT);
pinMode(11, OUTPUT);
}
void loop()
{
unsigned long currentMillis = millis();
if(currentMillis - previousMillis > interval) {
// save the last time you blinked the LED
previousMillis = currentMillis;
if (ledState == LOW)
ledState = HIGH;
else
ledState = LOW;
digitalWrite(ledPin, ledState);
colorWipe(strip.Color(255, 0, 0),50);
colorWipe(strip.Color(255, 100, 0),50);
colorWipe(strip.Color( 0, 255, 0),50);
rainbow(40);
digitalWrite(11, HIGH);
digitalWrite(12, HIGH);
}
}
void rainbow(int wait) {
for(long firstPixelHue =0; firstPixelHue < 5*65536; firstPixelHue += 256) {
strip.rainbow(firstPixelHue);
strip.show();
}
}
void colorWipe(uint32_t color, int wait) {
for(int i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, color);
strip.show();
}
}
//ENDE
After strip.show() was a delay(wait)
I'm using a Arduino UNO