Hi and first of all thanks for reading my post much apreciated.
i do have some experiance with microcontrollers as iv just completed a degree in computer engenering and based my project on the arduino but i have also used philips 8051 (old micro :S) and the XA arcitecture
Here is the project.
3 strips of RGB leds all common cathode. The RGB strips are souced and sinked by P and N channel FETS (three P channel for the RGB anode pins and three N channel FETS to controll which strip is on at a time.)
what im trying to do is controll the individule colour of each strip using the same RGB pins.
i have the P channel fets rigged up to 3 of the PWM pins and the N type FETs rigged up to the other 3 PWM pins.
but i cant seem to multiplex the colours out of the 3 strips without gettin either erratic flashing or huge amounts of bleeding from the previous strips data. (data being wether R G or B is lite)
here is my current code.
//RGB Controller With brightness
int Left = 6;
int Center = 5;
int Right = 3;
int Red = 11;
int Green = 10;
int Blue = 9;
// row then columns
//------LEFT------||-----Center-----||------Right-----|//
// R G B Alum|| R G B Alum|| R G B Alum|
int Display[3][4]={{255,0,0,255}, {0,255,0,255}, {0,0,255,255}};
void setup ()
{
// Test
}
// R,G,B 0-255 strip is L left M middle R right
void loop() //this is the multiplexing loop
{
multiplex();
}
void multiplex()
{
analogWrite(Center,0);
analogWrite(Right,0);
analogWrite(Red,Display[0][0]);
analogWrite(Green,Display[0][1]);
analogWrite(Blue,Display[0][2]);
analogWrite(Right,Display[0][3]);
delay(6);
analogWrite(Center,0);
analogWrite(Right,0);
delay(2);
analogWrite(Red,Display[1][0]);
analogWrite(Green,Display[1][1]);
analogWrite(Blue,Display[1][2]);
analogWrite(Center,Display[1][3]);
delay(6);
analogWrite(Center,0);
analogWrite(Right,0);
delay(2);
}
please can some one point out wear i am going wrong…is it that i cant syncronise the PWM pins or is it that the analougeWrite function takes to long. if so how would i multiplex it without using the PWM function and maybe writing my own ?