Two days ago, my code is working fine on the arduino board. But yesterday, and today I tried so many time to upload the arduino code, which contains 1000 lines of code. It was successfully uploaded the code into arduino. But it only upload half code into arduino when I saw the serial monitor results (I use serial println(); test where the code is located. ) I am so confusing, why the code is working fine two days ago. but later, only half code being used. Please help.
Here is the memory I left when I uploaded it.
Sketch uses 48,314 bytes (19%) of program storage space. Maximum is 253,952 bytes. Global variables use 2,603 bytes (31%) of dynamic memory, leaving 5,589 bytes for local variables. Maximum is 8,192 bytes.
Here is the code it stuck :
Get Parameters
//
// This function reads the information from the SD card for a given monitoring
// site.
//
//
int getParameters(){
String lowerLimit, upperLimit;
char buffer[36];
char newChar;
int index, index1, index2, index3, line, theLength, numSensors;
myFile.setTimeout(2000);
line = 0;
while (myFile.available()) {
index = 0;
do{
newChar = myFile.read();
buffer[index] = newChar;
index += 1;
}
while(newChar != 10);
buffer[index] = 0;
theLines[line] = buffer;
Serial.print(theLines[line]);
//here the result is something like this
//theLines[0] , class 111
//theLines[1] , 192.168.1.10
//theLines[2] , Mac Address
line += 1;
}
//so it is working fine above the code. But here is the problem stuck.
//the code cannot go through the rest of the code below. Nothing happened!!!
for (int line = 0; line < 10; line++){
Serial.print(theLines[line]);
}