Square matrix/array

Hey guys, i'm just wondering how I can go about creating a 60x60 array. The values contained will all be <100.

What i'd be doing is essentially reading an input 3600 times but after every 60 reads, shifting to a new row (if that makes sense) so an example of a quick 5x5 array would be:

array[5, 5] =
{ read1, read2, read3, read4, read5;
read6, read7, read8, read9, read10;
read11, read12, read13, read14, read15;
read16, read17, read18, read19, read20;
read21, read22, read23, read24, read25;}

Can I do it like this? Also will the arduino have enough space for 3600 pieces of data at less than a byte each?

Cheers,

Unless you implement some form of compression algorithm, or have a microcontroller with lots of RAM, you won't.

A 60x60 array of bytes is 3600 bytes. The UNO certainly can't hold that much, having only 2K of RAM.

You might be able to do it with a MEGA (not sure what RAM they have off hand).

Anyway, the syntax is:

byte myArray[60][60];

As for memory, the chip on the UNO has 2k, so the answer is no. With the Mega you can have 8k, which could be enough also for the rest of your program. See Arduino Playground - Memory.

In a two-dimensional array you can put the n-th element of your sequential input into position n/60, n%60 (or n%60, n/60, depending on how you interpret rows and columns). But since your input is sequential you may as well 'flatten' the array to one dimension. Then if you want to know the value in row r and column c you access the element at position r * 60 + c (both r and c starting from 0).

Another option is a '1284P based board, with its 16K SRAM.
http://www.crossroadsfencing.com/BobuinoRev17/

I'd suggest you rethink why you want to have this giant array.

If your values fit (or could be made to fit) into four bits, then you could probably do it (1800 bytes).
On the other hand, I can't think of many things wider than a few bits that could read at those kind of rates on an Arduino anyway.

Hey guys, cheers for all the help! I decided in the end to just send each piece of data to my computer over serial then use megunolink to place that data into a text file. Thanks anyway!