Hello and thank you for any feed back in advanced. I am getting unexpected results printing on my serial monitor. The unitNames[][] is not printing correctly. I am not sure if is a coding issue or a memory issue. I am using a Mega.
String houseCodes[16] = {"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P"};
String unitCodes[16] = {"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16"};
String unitIDs[16][16] = {
{"A1","B1","C1","D1","E1","F1","G1","H1","I1","J1","K1","L1","M1","N1","O1","P1"},
{"A2","B2","C2","D2","E2","F2","G2","H2","I2","J2","K2","L2","M2","N2","O2","P2"},
{"A3","B3","C3","D3","E3","F3","G3","H3","I3","J3","K3","L3","M3","N3","O3","P3"},
{"A4","B4","C4","D4","E4","F4","G4","H4","I4","J4","K4","L4","M4","N4","O4","P4"},
{"A5","B5","C5","D5","E5","F5","G5","H5","I5","J5","K5","L5","M5","N5","O5","P5"},
{"A6","B6","C6","D6","E6","F6","G6","H6","I6","J6","K6","L6","M6","N6","O6","P6"},
{"A7","B7","C7","D7","E7","F7","G7","H7","I7","J7","K7","L7","M7","N7","O7","P7"},
{"A8","B8","C8","D8","E8","F8","G8","H8","I8","J8","K8","L8","M8","N8","O8","P8"},
{"A9","B9","C9","D9","E9","F9","G9","H9","I9","J9","K9","L9","M9","N9","O9","P9"},
{"A10","B10","C10","D10","E10","F10","G10","H10","I10","J10","K10","L10","M10","N10","O10","P10"},
{"A11","B11","C11","D11","E11","F11","G11","H11","I11","J11","K11","L11","M11","N11","O11","P11"},
{"A12","B12","C12","D12","E12","F12","G12","H12","I12","J12","K12","L12","M12","N12","O12","P12"},
{"A13","B13","C13","D13","E13","F13","G13","H13","I13","J13","K13","L13","M13","N13","O13","P13"},
{"A14","B14","C14","D14","E14","F14","G14","H14","I14","J14","K14","L14","M14","N14","O14","P14"},
{"A15","B15","C15","D15","E15","F15","G15","H15","I15","J15","K15","L15","M15","N15","O15","P15"},
{"A16","B16","C16","D16","E16","F16","G16","H16","I16","J16","K16","L16","M16","N16","O16","P16"}
};
String unitNames[16][16] = {
{"empty unit a" , "empty unit b" , "empty unit c" , "empty unit d" , "empty unit e" , "empty unit f" , "empty unit g" , "empty unit h" , "empty unit i" , "empty unit j" , "empty unit k" , "empty unit l" , "empty unit m" , "empty unit n" , "empty unit o" , "empty unit p"},
{"empty unit a" , "empty unit b" , "empty unit c" , "empty unit d" , "empty unit e" , "empty unit f" , "empty unit g" , "empty unit h" , "empty unit i" , "empty unit j" , "empty unit k" , "empty unit l" , "empty unit m" , "empty unit n" , "empty unit o" , "empty unit p"},
{"empty unit a" , "empty unit b" , "empty unit c" , "empty unit d" , "empty unit e" , "empty unit f" , "empty unit g" , "empty unit h" , "empty unit i" , "empty unit j" , "empty unit k" , "empty unit l" , "empty unit m" , "empty unit n" , "empty unit o" , "empty unit p"},
{"empty unit a" , "empty unit b" , "empty unit c" , "empty unit d" , "empty unit e" , "empty unit f" , "empty unit g" , "empty unit h" , "empty unit i" , "empty unit j" , "empty unit k" , "empty unit l" , "empty unit m" , "empty unit n" , "empty unit o" , "empty unit p"},
{"empty unit a" , "empty unit b" , "empty unit c" , "empty unit d" , "empty unit e" , "empty unit f" , "empty unit g" , "empty unit h" , "empty unit i" , "empty unit j" , "empty unit k" , "empty unit l" , "empty unit m" , "empty unit n" , "empty unit o" , "empty unit p"},
{"empty unit a" , "empty unit b" , "empty unit c" , "empty unit d" , "empty unit e" , "empty unit f" , "empty unit g" , "empty unit h" , "empty unit i" , "empty unit j" , "empty unit k" , "empty unit l" , "empty unit m" , "empty unit n" , "empty unit o" , "empty unit p"},
{"empty unit a" , "empty unit b" , "empty unit c" , "empty unit d" , "empty unit e" , "empty unit f" , "empty unit g" , "empty unit h" , "empty unit i" , "empty unit j" , "empty unit k" , "empty unit l" , "empty unit m" , "empty unit n" , "empty unit o" , "empty unit p"},
{"empty unit a" , "empty unit b" , "empty unit c" , "empty unit d" , "empty unit e" , "empty unit f" , "empty unit g" , "empty unit h" , "empty unit i" , "empty unit j" , "empty unit k" , "empty unit l" , "empty unit m" , "empty unit n" , "empty unit o" , "empty unit p"},
{"empty unit a" , "empty unit b" , "empty unit c" , "empty unit d" , "empty unit e" , "empty unit f" , "empty unit g" , "empty unit h" , "empty unit i" , "empty unit j" , "empty unit k" , "empty unit l" , "empty unit m" , "empty unit n" , "empty unit o" , "empty unit p"},
{"empty unit a" , "empty unit b" , "empty unit c" , "empty unit d" , "empty unit e" , "empty unit f" , "empty unit g" , "empty unit h" , "empty unit i" , "empty unit j" , "empty unit k" , "empty unit l" , "empty unit m" , "empty unit n" , "empty unit o" , "empty unit p"},
{"empty unit a" , "empty unit b" , "empty unit c" , "empty unit d" , "empty unit e" , "empty unit f" , "empty unit g" , "empty unit h" , "empty unit i" , "empty unit j" , "empty unit k" , "empty unit l" , "empty unit m" , "empty unit n" , "empty unit o" , "empty unit p"},
{"empty unit a" , "empty unit b" , "empty unit c" , "empty unit d" , "empty unit e" , "empty unit f" , "empty unit g" , "empty unit h" , "empty unit i" , "empty unit j" , "empty unit k" , "empty unit l" , "empty unit m" , "empty unit n" , "empty unit o" , "empty unit p"},
{"empty unit a" , "empty unit b" , "empty unit c" , "empty unit d" , "empty unit e" , "empty unit f" , "empty unit g" , "empty unit h" , "empty unit i" , "empty unit j" , "empty unit k" , "empty unit l" , "empty unit m" , "empty unit n" , "empty unit o" , "empty unit p"},
{"empty unit a" , "empty unit b" , "empty unit c" , "empty unit d" , "empty unit e" , "empty unit f" , "empty unit g" , "empty unit h" , "empty unit i" , "empty unit j" , "empty unit k" , "empty unit l" , "empty unit m" , "empty unit n" , "empty unit o" , "empty unit p"},
{"empty unit a" , "empty unit b" , "empty unit c" , "empty unit d" , "empty unit e" , "empty unit f" , "empty unit g" , "empty unit h" , "empty unit i" , "empty unit j" , "empty unit k" , "empty unit l" , "empty unit m" , "empty unit n" , "empty unit o" , "empty unit p"},
{"empty unit a" , "empty unit b" , "empty unit c" , "empty unit d" , "empty unit e" , "empty unit f" , "empty unit g" , "empty unit h" , "empty unit i" , "empty unit j" , "empty unit k" , "empty unit l" , "empty unit m" , "empty unit n" , "empty unit o" , "empty unit p"}
};
void setup() {
Serial.begin(115200);
delay(20);
Serial.println(" ");
Serial.println(" ");
Serial.println(" ");
Serial.println(" ");
Serial.println(" ");
Serial.println(" ");
for (int thisHouseCodeIndex = 0; thisHouseCodeIndex < 16; thisHouseCodeIndex++){
for (int thisUnitCodeIndex = 0; thisUnitCodeIndex < 16; thisUnitCodeIndex++){
Serial.print("HouseCode: ");
//String myHouseCode = houseCodes[thisHouseCodeIndex];
Serial.print(houseCodes[thisHouseCodeIndex]);
delay(20);
Serial.print(" ");
Serial.print("UnitCode: ");
// String myUnitCode = unitCodes[thisUnitCodeIndex];
Serial.print(unitCodes[thisUnitCodeIndex]);
delay(20);
Serial.print(" ");
Serial.print("UnitID: ");
String myUnitID = unitIDs[thisUnitCodeIndex][thisHouseCodeIndex];
Serial.print(unitIDs[thisUnitCodeIndex][thisHouseCodeIndex]);
delay(20);
Serial.print(" ");
Serial.print("UnitName: ");
// String myUnitName = unitNames[thisUnitCodeIndex][thisHouseCodeIndex];
Serial.print(unitNames[thisUnitCodeIndex][thisHouseCodeIndex]);
delay(20);
Serial.print(" ");
Serial.println(" ");
delay(20);
}
Serial.println(" "); //---House Code: " + houseCode[i]+" ---");
delay(20);
}
}
void loop() {
}