hi, havent posted in a while, nut i'm back again to try and get this button pad working! it's been lying in my room for over a year, and i posted before for help with less then great results, but hopefully we can get it up and running.
So i have the sparkfun button pad ( 4 x 4 buttons ) it's all hooked up and ready to go. and i'm using an arduino to control half of it. it sounds weird but im using 2 arduinos to control it because i have john ryan's dual core arduino board so i'm actually using one arduino to control each side of the button pad, and one of the arduino's also control the ground.
the way i have everything setup is:
i have the button pad led's rgb output from the sparkfun pcb hooked up to resistors, then connected to the arduino.
like i said, it will only control half of the button pad, but that's all i need for now...
the problem is, no matter how i setup my code, if i try to get one button on, and the rest off, other buttons turn on! the lights won't stay off on the buttons, it seems like the color "bleeds" off to the other button in that row. and i'm running it normally, one column of ground on, the rest off, one at a time, so i can control each button. ill post my code so you can see for yourself:
code:
int time = 1;
void setup() {
pinMode(8, OUTPUT);
pinMode(7, OUTPUT);
pinMode(4, OUTPUT);
pinMode(2, OUTPUT);
}
void loop(){
digitalWrite(8, LOW);
analogWrite(10, 255); // turns the blue on
delay(time);
digitalWrite(8, HIGH);
analogWrite(10, 0); // turns the blue off
delay(time);
digitalWrite(7, LOW);
delay(time);
digitalWrite(7, HIGH);
delay(time);
digitalWrite(4, LOW);
delay(time);
digitalWrite(4, HIGH);
delay(time);
digitalWrite(2, LOW);
delay(time);
digitalWrite(2, HIGH);
}
this code controls the grounds so they are connected one at a time. and just as a test i turn one color on the see it work. the above effect works when the "time" integer is set to 100 ( runs the refresh rate very slowly ) but when i speed it up the "time" integer to 1, the lights on the button freak out and the button i told to turn on and the button before it both turn on and make a dimming effect. the button i want to work dimms on, while the button next to it dimms off... not sure why it isint working right.
if your not sure what i'm talking`about think of this:
how would you make the sparkfun button pad work with the arduino? ( considering you only make half of the button pad light up. )
and just as extra info, i'm using 2 arduinos because i want pwm control of the lights, i dont want just on or off, that's why its more complicated... sure just having on or off could produce, what, 7 colors? i'd rather have the whole color spectrum at my disposal.
thanks for any help, and i'll try to post the results of the above sketch in the next couple of minutes.
edit: i took a quick video with my phone:
IGNORE THE BOTTEM ROW THAT IS CONSTANTLY ON, focus on the two buttons that are flickering... they shouldn't do that, one is just sapposed be on, the other off
will be processing for a few mins...