Introduction: Led Marble (in Progress)

Alright, here we go. I am attempting to make a small arduino toy using an accelerometer and some LEDs. The LEDs are arranged in a circle and depending on the told of the circuit, the corps pounding led will light up as if it was a marble with inertia. I am going to build this with an arduino nano.

Step 1: Let's Build the Damn Thing.

To start we need to figure out how we are going to build it. We're going to be doing some good ol' fashioned multiplexing. The arduino only has so many outputs so we will have to trick it a little.

Start with drawing out your plan. Lay out a grid with the corresponding amount of LEDs you would like to use. You should really do this step, I tried to cut corners and I made a healthy rats nest of a circuit.

I'm using 12 LEDs so my grid looks something like this.

Next you need to understand the wiring.

If we want the second led in the third row. We would turn on B3. If we want the last led in the first row we turn on C1. From here you can turn on which ever led you'd like.

Note: keep in mind that you will need a 220k resistor so to not blow out your LEDs. But you only need them on the columns and not at every LED.

Step 2: The Good Stuff.

Let's start to lay out the circuit. I drew a circle onto some proto board with a pencil which made it easier to arrange. I know radio shack has some round PCB but who need the shack anyways.

Once arranged, go back and look at your drawing of the grid. We want the LEDs to run through as if they were in a line. So we need to wire them accordingly. It makes it a lot easier to figure this out now rather than later.

On my drawing we can see the columns and rows. If I want to orient them in a line then I should probably write it out.

1A 1B 1C 2A 2B 2C 3A 3B 3C 4A 4B 4C

And we will figure out how to make it loop back to the beginning.

This is my board.

There aren't any resistors yet but I've decided to out then with the columns so that way there's only three of them.

Step 3: Start Your Engines.

I'm starting with tacking everything in place.

After the LEDs are in for good, we start to comprehend how were going to wire this sucker. I have a bunch of blue wire. All you pros out there might be thinking, red and black would be very easy to organize. Well I like blue and it's all I got, so whatever.

So let's go in order. Starting with the columns. A1 which is the first led. A2 which is the 4th led. A3 which is the 7th led and lastly A4 which is the 10th led.

For that column we will soldering wire jumping to those in order. It will save your brain to start with a resistor. I put a few up top and out if the way.

The B column. B1 is the 2nd led, B2 is the 5th led. B3 is the 8th led and B4 is the 11th.

The C column. C1 is the 3rd led. C2 is the 6th led. C3 is the 9th led and C4 is the 12th led.

Once you finish with the columns you will start to get the idea.

Wire up the rows next and keep an eye on the grid you drew.

Step 4: Let Get Digital

Lets pull out your duino.

we need to talk to this thing and tell it whats up.

int rows[]={5,6,7,8};
int columns[]={2,3,4};

This is what we have right now. Our rows 1,2,3,4 will be in pine 5,6,7,8. And out columns A,B,C will be in pins 2,3,4.

I would put in an int for the linear array.

int loop []={