I'm probably not ready for this matrix post, but you only live once...

I was wondering, how hard would it be to use a two axis accelerometer to control a small square on a LED matrix? I'm thinking of using an 8x8 LED matrix and lighting a box of 2X2 that moves around. So if the sensor was level, the box would be in the middle of the matrix, tilt it left and the dot moves left, etc. The further you move it to the left, the further the box moves. Easy project? (I'm trying to learn, still a noob, so don't get too technical on me please.) :smiley:

Been spending the evening reading.

It seems the easiest way is to get a MAX7219 controller chip and using the library in the playground. Question:

Tutorial says to use the following command for individual LEDs:

void setLed(int addr, int row, int col, boolean state);

Is the "void" there just to make the program work, or does each line in the code for this command require the word "void" in front of it? In other words, would this work (assuming values are put in the parentasis):

void loop;

setLed(int addr, int row, int col, boolean state);

The void means that the function does not return any value. If it returned an integer then the void would be replaced by int. It is part of the definition of functions in C++. If you intend to program it is worth looking at some of the online tutorials for hoe to use this programming language.

You do not need the void before each command. The void is part of the setLed function definition in the LedControl library and it tells the compiler that no values will be returned by this function when called.
Just use something like this and it will work.

//setLed(device,row,column,state)
lc.setLed(0,0,3,true);

c131frdave:
I was wondering, how hard would it be to use a two axis accelerometer to control a small square on a LED matrix? I'm thinking of using an 8x8 LED matrix and lighting a box of 2X2 that moves around. So if the sensor was level, the box would be in the middle of the matrix, tilt it left and the dot moves left, etc. The further you move it to the left, the further the box moves. Easy project? (I'm trying to learn, still a noob, so don't get too technical on me please.) :smiley:

'Easy' is relative :slight_smile: ... but what have you got to lose?

I'd start by controlling it with two potentiometers (X and Y), add the accelerometer later if that part works out.

That's a great idea. Thanks! And thanks to everyone else as well. I appreciate the help.