hello people
i have a problem when trying to read from my arduino serial...
i have this code in a function which i call from setup() :
void serial_read_data(){
while(1){
if (Serial.available()) {
tmp = Serial.read();
serialread[k]=tmp;
k++;
int len;
char* filename;
len=strlen(serialread);
Serial.println(len);
filename = serialread + (len-3);
//Serial.println((char*)serialread);
if(strcmp (strstr (serialread,"END"),filename) == 0)break;
}
unless i have the commented " //Serial.println((char*)serialread);" line enabled it breaks before it's time...
I cannot figure out why...
the same happens to both my duemillanove and mega...
any ideas or alternatives??
I want to read the serial to a buffer untill a specific sequence of characters arrives and then it breaks...
ANY HELP???? >
