int notearray[3][10]; /// For some reason, it doesn't think the array is declared if I don't put it up here ..
void setup(void)
{
Serial.begin(9600); // 31250
mode = MODE_CLOSED;
/// EEPROM READING DONE HERE ///
int notearray[3][10] = {
{EEPROM.read(1), EEPROM.read(2), EEPROM.read(3), EEPROM.read(4), EEPROM.read(5), EEPROM.read(6), EEPROM.read(7), EEPROM.read(8), EEPROM.read(9), EEPROM.read(10)},
{EEPROM.read(11), EEPROM.read(12), EEPROM.read(13), EEPROM.read(14), EEPROM.read(15), EEPROM.read(16), EEPROM.read(17), EEPROM.read(18), EEPROM.read(19), EEPROM.read(20)},
{EEPROM.read(21), EEPROM.read(22), EEPROM.read(23), EEPROM.read(24), EEPROM.read(25), EEPROM.read(26), EEPROM.read(27), EEPROM.read(28), EEPROM.read(29), EEPROM.read(30)}
};
Serial.println(notearray[0][0]); // This one works
}
void loop(void)
{
switch (mode)
{
//---------------------------------------------------------------------
case MODE_CLOSED: // All Off
{
// Clear the playarray - active is high - 1
for (int i = 0; i < 10; i++){
_playarray[0][i] = 0;
}
for (int i = 0; i < 10; i++){
_playarray[1][i] = 0;
}
prevRow = 0;
currRow = 1;
digitalWrite(BLANKING_RED, LOW);
digitalWrite(BLANKING_GREEN, LOW);
int result = ButtonRead();
if (result == BUTTON_RED)
{
mode = MODE_OPENING;
}
if (result == BUTTON_BLACK)
{
mode = MODE_CAL;
}
if (dumpdata == 1){
//String dumpstring1 = "a";
//dumpstring1 = dumpstring1 + "," + notearray[0][1] + "," + notearray[0][2];
Serial.println(notearray[0][0]); // This one doesn't
dumpdata = 0;
}
}
}
}
If I remove that int notearray[3][10]; from the top, it complains about notearray not being defined (On the 2nd Serial.print, but not the first one). It's almost like the array is being contained within setup, and not shared with the loop?