2 LPD8806 LED Strips controlled simultaneously
i kind of noob when comes programming, know little. can 1 change code can control 2 separate strips simultaneously running different variations of colorwipe() function.
thank you
thank you
quote
#include "lpd8806.h"
#include "spi.h"
// example control lpd8806-based rgb led modules in strip
/*****************************************************************************/
// choose 2 pins use output.
// can valid output pins.
int datapin = 2;
int clockpin = 3;
// set first variable number of pixels. 32 = 32 pixels in row
// led strips 32 leds per meter can extend/cut strip
lpd8806 strip = lpd8806(32, datapin, clockpin);
// can use hardware spi, ultra fast writes leaving out the
// data , clock pin arguments. 'fix' pins following:
// on arduino 168/328 thats data = 11, , clock = pin 13
// on megas thats data = 51, , clock = 52
//lpd8806 strip = lpd8806(32);
void setup() {
// start led strip
strip.begin();
// update strip, start 'off'
strip.show();
}
void loop() {
// fill entire strip with...
colorwipe(strip.color(127,0,0), 10); // red
colorwipe(strip.color(0, 127,0), 10); // green
colorwipe(strip.color(0,0,127), 10); // blue
}
\
// fill dots 1 after other said color
// testing purposes
void colorwipe(uint32_t c, uint8_t wait) {
int i;
(i=0; < strip.numpixels(); i++) {
strip.setpixelcolor(i, c);
strip.show();
delay(wait);
}
}
why dont run clock , data out 1 strip clock , data other strip.
so if first strip has 32 leds, on 32 leds go second strip.
so if first strip has 32 leds, on 32 leds go second strip.
Arduino Forum > Using Arduino > Programming Questions > 2 LPD8806 LED Strips controlled simultaneously
arduino
Comments
Post a Comment