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.

Microcontroller Programming » LED array

March 31, 2011
by jasongillikin
jasongillikin's Avatar

So, I decided to make this girl an LED display... the array is going to be 5 columns by 6 rows, so If my calc are correct I will need 8 Pins (3 for the rows and 5 for the columns. I have been thinking about how to design the code and here is what I came up with.

I want the entire array to cycle at 60hz, and since I can only have one column on at a time, I need to have each individual column to cycle at 300hz (60hzX5col) which leaves me with a period of 3333us.

so basically, I will turn each of the 5 columns on for 3333us and then loop that 60 times and I should end up with 1 second... 3333us X 5cycles X 60 cycles

what I can't find anywhere is how to set a pin high or low... what register is it controlled in? I know DDR will have to be set to 1 for output.

but how do you determine the state, (high, low, or off) with only two choices 1 or 0...

any help would be great,


April 06, 2011
by hevans
(NerdKits Staff)

hevans's Avatar

Hi Jason,

If you are confused about just setting digital pins read over the NerdKits Guide, particularly the LED Blink project.

You are correct that in our implementation of the LED Array uses the concept of a high pin, and low pin, and an off pin. This is accomplished by turning the pin into an input pin when we want to be "off", so as an output high it will source current, as an output low it will sink current, and an input pin will not allow current to flow. Does that make sense?


Post a Reply

Please log in to post a reply.

Did you know that NerdKits has been featured on Slashdot, Hack A Day, Hacked Gadgets, the MAKE blog, and other DIY-oriented websites? Learn more...