make LEDs 'aware' of surrounding LEDs?

I tried looking for tutorials and examples of LED matrix software for Arduino, but I could not find the answer I was looking for... so hopefully you guys can help this rookie getting started on this :)


I want to create a 12x12 LED Matrix using the the Displayduino & LEDMatrix (http://mondomatrix.com/info/?page_id=317) programmable in Arduino and Processing. To simplify the question, let's assume that each LED in the matrix also contains a simple push button.

What I want to create is when I push one of the buttons on this 12x12 grid, the LED will go on. The surrounding ring of LEDs has to be slightly dimmed, the 2nd ring has to be even more dimmed, and maybe even another ring of LEDs that is almost off to create this gradient light circle effect centered around the button I pushed. I want to create multiple of these light glows simultaneously on the grid, where the size/intensity of the light circle depends on how long you push the button.

So my question is: how can I easily program this? In my opinion I have to program Arduino (or maybe Processing, what's better?) in such way that the LEDs have a sense of the other LEDs surrounding them in order to easily create these kind of patterns. Are there corresponding examples, or can you guys help me to get me started? Much appreciated! :)

What you need to read is about array accesses, paying particular attention to pixels near to the edges of the array.

This'll develop into Conway's 'Life' before long. Shortly after that, it'll go sentient.

Thnx, I'm currently looking into two dimensional arrays for Arduino... but what do you exactly mean with 'paying particular attention to pixels near to the edges of the array'? What's the danger there?

The danger is accessing elements that aren't there, but may appear to be. Or appear not to be. C is a simple language, and will not protect you from out of bounds array accesses, and neither will the processor - a killer combination.

This is basically what a monome does. Only it reports pushes to the serial port and gets instructions about what to light from the serial port. However there is noting stopping you from making the connection in software. So see:- http://monome.org/ However many monomes don't dim, that requirement makes your matrix drivers more difficult. You could multiplex some TLC5940 ICs, I recommend only multiplexing 4 to 1 so for 144 LEDs you will need three of them. For how to do this see:- http://www.thebox.myzen.co.uk/Hardware/Mini_Monome.html

@Grumpy_Mike I want to use this board (http://mondomatrix.com/info/?page_id=317) which includes LED drivers to have 192 LEDs (or 64 RGB's) individually controllable/dimmable. This should work I guess, let me know what you think?

And thanks for the monomo link, I'll take a look!

I'm getting a slight idea how to make this gradient glow effect... but another question that pops up now is:

How to 'multitask' this? So how do I create this glow, and simultaneously read out the buttons and add new glows to the matrix. (and maybe even fade out the first glow while the second one is still there). Any keywords for me to look into?

How to 'multitask' this?

Once you have set the LEDs to be a certain brightness then there is nothing to do until the next change in brightness. When this time has elapsed then tweek the values again. Look for the "blink without delay" example to see how to set a time for the next action.

and simultaneously read out the buttons

You don't simultaneously read but you do it one after the other so quick and so often that it looks and feels simultaneous.

That link looks like it will do the job but is a bit complex in that:-

All MondoMatrix expansion boards must be connected to the main controller (Displayduino) to work. The connections are made using the RS485 network and there is an RS485 network port on all of the MondoMatrix boards.

Also it claims to be open source hardware but I couldn't find the schematics or PCB layout to download. Without that it's not open source hardware.