Question: I created some code that uses two LED arrays for an LPD8806 strip. One array displays much brighter than the other. Any ideas?
We need more info to help you. How about sharing the code your using, and how you have things wired/connected together?
Without these, it’s like sorting fly shit from pepper;) == impossible
Here’s the code. What I’m trying to do is use 2 LED arrays on the same strip. Is this possible?
#include <PS2X_lib.h> //for v1.6
#include “FastLED.h”
#define PS2_DAT 28
#define PS2_CMD 30
#define PS2_SEL 32
#define PS2_CLK 34
#define NUM_LEDS 160
#define pressures false
#define rumble false
#define DATA_PIN 51
#define CLOCK_PIN 52
PS2X ps2x; // create PS2 Controller Class
int error = 0;
byte type = 0;
byte vibrate = 0;
byte R; //color of fret button pushed
byte G; //color of fret button pushed
byte B; //color of fret button pushed
int strum; //up or down strum
CRGB leds[2][NUM_LEDS];.
void setup(){
FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds[0], NUM_LEDS);
FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds[1], NUM_LEDS);
}
void loop() {
delay(2000);
type = 2; //force controller type
while(1){
ps2x.read_gamepad(); //read controller
if(ps2x.Button(GREEN_FRET)){
R=0,G=127,B=0;}
if(ps2x.Button(RED_FRET)){
R=127,G=0,B=0;}
if(ps2x.Button(YELLOW_FRET)){
R=127,G=64,B=0;}
if(ps2x.Button(BLUE_FRET)){
R=0,G=0,B=127;}
if(ps2x.Button(ORANGE_FRET)){
R=127,G=20,B=0;}
if(ps2x.Button(UP_STRUM)){//will be TRUE as long as button is pressed
leds[0][0].setRGB(G,R,B);}
if(ps2x.Button(DOWN_STRUM)){//will be TRUE as long as button is pressed
leds[1][NUM_LEDS-1].setRGB(G,R,B);}
for(int i=NUM_LEDS-1; i>0; i--){
leds[0][i]=leds[0][i-1];
leds[0][i-1]-=CRGB(4,4,4);//speed of dim
}
for(int j=0; j<NUM_LEDS-1; j++){
leds[1][j]=leds[1][j+1];
leds[1][j+1]-=CRGB(4,4,4);//speed of dim
}
FastLED.show();
delay(5);
R=0;
G=0;
B=0;
}
}//end of Loop
Now, can you describe your wiring schematic and how you are powering everything?
I am using an Arduino Mega and a computer power supply. 12 volt and ground from the power supply are connected to the Vin and ground on the Mega. 5V from the power supply is connected to the +5V on the strip. Ground from the strip is connected to ground on the Mega. Clock and data from the strip are connected to pin 52 and pin 51 on the Mega, respectively. I have a PS2 controller that uses the 3.3V and ground from the Mega. It also is connected to pins 28, 30, 32, and 34. Thanks.