2D Array and total destruction
hello arduino community,
although first post forum i'm not new arduino, have been fiddling them years now. don't have many problems because find solution on fabulous forum or internet in general time i'm stumped...
all right don't use 2d arrays often, , i'm working on project needs rather massive 2d byte array. yes , yes calculated how ram using , came out modiste 1.4kb figured usage wasn't problem.
ok setting array goes it's massiveness:
ok far program compiles , runs fine above lines in program. real fun start when added in these lines of code:
as uploaded , ran instantly pooped out , froze. oh gets better! refused reprogrammed, heard me right wouldn't except new sketch. tried atmega328 first starting initialization lines (works fine) loop (chaos). i'm betting i'm going have re-burn bootloader chip functional again.
any thoughts on why loop creating such commotion? i'm fundamentally approaching wrong way. think got arduino bootloader stuck in kinda infinite loop preventing being programmed on serial...
thanks in advance!
although first post forum i'm not new arduino, have been fiddling them years now. don't have many problems because find solution on fabulous forum or internet in general time i'm stumped...
all right don't use 2d arrays often, , i'm working on project needs rather massive 2d byte array. yes , yes calculated how ram using , came out modiste 1.4kb figured usage wasn't problem.
ok setting array goes it's massiveness:
code: [select]
#define defaultscale 1
#define defaultkey 2
byte scalevalues [50] [10] = {
{0,2,4,5,7,9,11,12,14,16},
{0,2,3,5,7,9,11,12,14,15},
{0,2,3,5,7,8,11,12,14,15},
{0,2,5,7,9,12,14,17,19,21},
{0,3,5,7,10,12,15,17,19,22},
{0,3,5,6,7,10,12,15,17,18},
{0,2,5,7,10,12,14,17,19,22},
{0,3,5,6,8,10,11,13,15,17},
{0,2,3,5,7,9,10,12,14,15},
{0,2,4,5,7,9,10,12,14,16},
{0,1,3,5,7,8,10,12,13,15},
{0,2,4,6,7,9,11,12,14,16},
{0,1,3,5,6,8,10,12,13,15},
{0,1,3,4,6,7,9,10,13,15},
{0,2,3,5,6,8,9,11,14,15},
{0,2,4,6,8,10,14,16,18,20},
{0,3,4,7,8,11,15,16,19,20},
{0,3,5,6,7,10,12,15,17,18},
{0,2,4,7,9,12,14,16,19,21},
{0,1,4,5,7,8,11,12,13,16},
{0,1,4,6,8,10,11,12,13,16},
{0,2,4,6,8,9,10,14,16,18},
{0,1,3,5,7,9,11,12,13,15},
{0,1,3,5,7,8,10,12,13,15},
{0,2,4,6,9,10,12,14,16,18},
{0,1,4,5,8,9,12,13,16,17},
{0,2,4,6,7,8,10,12,14,16},
{0,2,3,6,7,8,10,12,14,15},
{0,2,3,4,6,7,8,9,11,12},
{0,2,3,5,6,8,9,11,12,14},
{0,2,4,6,8,10,12,14,16,18},
{0,1,3,4,6,7,9,10,12,13},
{0,2,4,5,6,8,10,12,14,16},
{0,2,4,6,7,9,10,12,14,16},
{0,1,3,4,6,8,10,12,13,15},
{0,2,3,5,7,8,10,12,14,15},
{0,2,5,7,9,10,12,14,17,19},
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0}
};
byte notevalues [12] = {60,61,62,63,64,65,66,67,68,69,70,71};
byte notes[10];
ok far program compiles , runs fine above lines in program. real fun start when added in these lines of code:
code: [select]
for(int = 0; < 10;i++){
notes[i] = notevalues[defaultkey] + scalevalues[defaultscale] [i];
}
as uploaded , ran instantly pooped out , froze. oh gets better! refused reprogrammed, heard me right wouldn't except new sketch. tried atmega328 first starting initialization lines (works fine) loop (chaos). i'm betting i'm going have re-burn bootloader chip functional again.
any thoughts on why loop creating such commotion? i'm fundamentally approaching wrong way. think got arduino bootloader stuck in kinda infinite loop preventing being programmed on serial...
thanks in advance!
usually sketch downloading work again, can:
press & hold down reset button.
start ide download.
when ide shows "compiled xxx of 32xxx bytes" or similar, release reset button.
might take couple of tries release @ right point.
press & hold down reset button.
start ide download.
when ide shows "compiled xxx of 32xxx bytes" or similar, release reset button.
might take couple of tries release @ right point.
Arduino Forum > Using Arduino > Programming Questions > 2D Array and total destruction
arduino
Comments
Post a Comment