NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Support Forum » LED Kit - Columns Backwards

May 29, 2011
by frankdwest
frankdwest's Avatar

Feeling stupid, but... I got confused on the directions despite their being very clear, and wired column 0 on the RIGHT hand side from the front (anodes). Is there a straightforward way this can be corrected in the software/wiring, or is this error require major surgery to correct (and thus probably beyond my current capabilities). If major surgery, can I purchase just the bag of LED's so I can do it correctly the second time ?

May 30, 2011
by frankdwest
frankdwest's Avatar

I ordered 120 new LED's from digikey. I think the code will need some in depth reconfiguring. Better to try again and do it right :-)

May 30, 2011
by Ralphxyz
Ralphxyz's Avatar

Sorry frankdwest, but you are not the first to do that :-)

I think if you search the forum you will find code to correct column 0 on the right.

You might have to read a lot of threads but that is your punishment.

Ralph

May 31, 2011
by frankdwest
frankdwest's Avatar

So...I think I can rotate the board 180 degrees. That puts Column 0 on the left from the front. However, it leaves the diodes all reversed from the original design. Looking at past forum posts I think I can make a correction in this code block:

// set column drivers appropriately 
uint8_t j; 
if(la_row%2 == 0) {   
   // even la_row number: fill even columns   
   real_row = la_row / 2;   
   for(j=0; j<COLS/2; j++) {     
   ledarray_set_columndriver(j, ledarray_get(real_row, 2*j), 1);   }   
   // activate row driver SINK   
   PORTB &= ~(1 << (PB1 + real_row));   
   DDRB |= (1 << (PB1 + real_row)); 
   } 
else {   
   // odd la_row number: fill odd columns   
   real_row = (la_row-1)/2;   
   for(j=0; j<COLS/2; j++) {     
   ledarray_set_columndriver(j, 1 - ledarray_get(real_row, 2*j + 1), 0);   
   }   
// activate row driver SOURCE   
PORTB |= (1 << (PB1 + real_row));   
DDRB |= (1 << (PB1 + real_row));

In the function ledarray_set_columndriver the third parameter is either 1 or 0 for source or sink. Swapping those in the above code should allow the test code to work with my wrongly wired LED panel. (?)

I am going to try this and see...

Frank

May 31, 2011
by bpenglase
bpenglase's Avatar

I ended up doing the same thing as you (at least I think by your description. My old post is here, where others helped me get it working. If you still can't get it working, let me know, I can post my full working code.

Post a Reply

Please log in to post a reply.

Did you know that you can follow NerdKits on Facebook, YouTube, and Twitter? Learn more...