Pages: [1]   Go Down
Author Topic: URGENT: Multi Dimensional Arrays with Arduino UNO  (Read 1969 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all.. smiley-wink
Im new to the Arduino Environment and I'am usin an Arduino Uno. I'am fluent with C++..and i was wondering if we could create multi-dimensional arrays.

I'am working on a project where I implementing an algorithm which requires me to create a 8x8 matrix.

A quick response would be appreciated!!!  :-/ :-/
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12737
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


int MyMatrix[8][8];
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Cheers...will I have any complications using an 8x8 matrix..? I might need two 8x8s dats like 128 elements (int)
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 197
Posts: 12737
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Cheers
Back at ya!

sizeof(int) = 2
sizeof(MyMatrix) = 8 * 8 * 2 = 128 bytes

Number of MyMatrix = 2

Total memory for MyMatrix = 128 * 2 = 256 bytes

http://arduino.cc/en/Main/ArduinoBoardUno
SRAM 2 KB (ATmega328)

2048 - 256 = [glow]1792 bytes left for stack and data[/glow].
« Last Edit: October 03, 2010, 02:17:56 am by bcook » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 3
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanx a million!!  ;D smiley-wink
Logged

Pages: [1]   Go Up
Jump to: