Moderators: adafruit_support_bill, adafruit
void colorWipe2(uint32_t c1, uint32_t c2, uint8_t wait) {
int i;
for (i=0; i < strip.numPixels()/2; i++) {
strip.setPixelColor(i, c1);
strip.show();
delay(wait);
}
for (i=0; i < strip.numPixels()/2; i++) {
strip.setPixelColor(i, c2);
strip.setPixelColor(i + strip.numPixels()/2, c1);
strip.show();
delay(wait);
}
for (i=0; i < strip.numPixels()/2; i++) {
strip.setPixelColor(i + strip.numPixels()/2, c2);
strip.show();
delay(wait);
}
}
void loop() {
// fill the entire strip with...
colorWipe2(strip.Color(127,0,0),strip.Color(0,127,0), 2187); // Red, then green
}for (i=strip.numPixels()/2; i >= 0; i-=2)int dataPin = 2;
int clockPin = 3;
// Set the first variable to the NUMBER of pixels. 32 = 32 pixels in a row
// The LED strips are 32 LEDs per meter but you can extend/cut the strip
LPD8806 strip = LPD8806(160, dataPin, clockPin);
// you can also use hardware SPI, for ultra fast writes by leaving out the
// data and clock pin arguments. This will 'fix' the pins to the following:
// on Arduino 168/328 thats data = 11, and clock = pin 13
// on Megas thats data = 51, and clock = 52
//LPD8806 strip = LPD8806(32);
int time = 2500;
int rod = 8;
int gul = 4;
int gron = 1;
void setup() {
// Start up the LED strip
strip.begin();
pinMode(rod, OUTPUT);
pinMode(gul, OUTPUT);
pinMode(gron, OUTPUT);
// Update the strip, to start they are all 'off'
strip.show();
}
void loop() {
colorWipe2(strip.Color(127,0,0),strip.Color(0,127,0), 500);
}
void colorWipe2(uint32_t c1, uint32_t c2, uint8_t wait) {
int i;
int x = 5;
x = 5;
//Tænder gul
digitalWrite(gul, HIGH);
delay(1000);
digitalWrite(gul, LOW);
//tænder røde
digitalWrite(rod, HIGH);
delay(8000);
digitalWrite(rod, LOW);
delay(0);
//tænder gul
digitalWrite(gul, HIGH);
delay(1000);
digitalWrite(gul, LOW);
delay(0);
if (x = 5) {
for (i=strip.numPixels()/2; i >= 0; i-=2) {
strip.setPixelColor(i, c2); // grøn
strip.setPixelColor(i + 1, c2); // grøn
strip.setPixelColor(i + strip.numPixels()/2, c1); //rød
strip.setPixelColor(i + (1) + strip.numPixels()/2, c1); // rød
strip.show();
delay(wait);
}
}
//Tænder grøn
digitalWrite(gron, HIGH);
x = 15;
delay(10000);
digitalWrite(gron, LOW);
delay(0);
if (x = 15) {
for (i=strip.numPixels()/2; i >= 0; i-=2) {
strip.setPixelColor(i, c1);
strip.setPixelColor(i +1, c1);
strip.setPixelColor(i + strip.numPixels()/2, c2);
strip.setPixelColor(i + (1) + strip.numPixels()/2, c2);
strip.show();
delay(500);
Serial.begin(300);
Serial.println(x);
}
}
}Return to Glowy things (LCD, LED, TFT, EL) purchased at Adafruit
Users browsing this forum: Google [Bot], GTBecker and 9 guests