Go Down

Topic: digitalwrite low?? (Read 1 time) previous topic - next topic


okay I have a problem and i need help, I created a 5x8 matrix, i wired the cathodes horizontally


and i wired the anodes vertically,
!  !  !  
!  !  !
!  !  !  
v  v v

and no they are not touching. the anodes are raised above the cathodes.

My problem begins when I try to light up the leds, i should light it up as
R_1 (row 1) (digitalWrite, r_1, HIGH);
c_1 (column 1) set as digitalWrite(c_1, LOW); ?

i tried this but it wont work? yet if i just hook up c_1 directly to ground the led lights up but its very dim, i have tried reversing them but that way it doesnt light up.

if i wire up 5v to row 1 and ground to column 1 then yes the led lights up, they all light up individually i tested them but i cant get it to work using digitalWrite LOW, or am I doing it wrong? below is my code. any help would be appreciated. Oh theres 8 anodes and 5 cathodes. so a total of 13 pins.

Code: [Select]

int r_1 = 52;
int r_2 = 50;
int r_3 = 48;
int r_4 = 46;
int r_5 = 44;

int c_1 = 22;
int c_2 = 24;
int c_3 = 26;
int c_4 = 28;
int c_5 = 30;
int c_6 = 32;
int c_7 = 34;
int c_8 = 36;

void setup(){
 (c_1, OUTPUT);
 (c_2, OUTPUT);
 (c_3, OUTPUT);
 (c_4, OUTPUT);
 (c_5, OUTPUT);
 (c_6, OUTPUT);
 (c_7, OUTPUT);
 (c_8, OUTPUT);
 (r_1, OUTPUT);
 (r_2, OUTPUT);
 (r_3, OUTPUT);
 (r_4, OUTPUT);
 (r_5, OUTPUT);


void loop(){
 digitalWrite(r_1, LOW);


Did you mean to leave off the pinMode name?

Code: [Select]
void setup(){
 pinMode(c_1, OUTPUT);
 pinMode(c_2, OUTPUT);
 pinMode(c_3, OUTPUT);


The Quick Shield: breakout all 28 pins to quick-connect terminals


ahh no I didnt =[
i already fixed it but still nothing, what i also did now was instead of connecting it the cathode to pin 52 i went directly to ground and the led lit up, brighter than before so thats a good sign right?


Yes, that's a good sign. Are you using series resistors? I wouldn't hook up an LED directly to port pins for both current source/sink without a current-limiting resistor.

The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, light sensor, potentiometers, pushbuttons


yea, well i have a resistor connected between the matrix's anodes and the arduino pins, should i do it for all the pins? or just anodes?


If you think a little bit about what those resistors are meant for you should be able to answer this question by yourself.


I have tried =\, for some reason now a whole column lights up with the new code and the resistors attached to the 8 anodes and not the other 5 cathodes. Is my wiring correct? resistors arent they used to limit current?

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131