Hello,
please excuse my bad english.
I have a code with which I query and evaluate a serial input.
It works great with the Arduino, but the teensy hangs in the while loop. Why is that?
What do I have to change to use it with the teensy?
Hope you can help me.
Best regards
please excuse my bad english.
I have a code with which I query and evaluate a serial input.
It works great with the Arduino, but the teensy hangs in the while loop. Why is that?
What do I have to change to use it with the teensy?
Code:
//G-code parser begin
float parsenumber(char code, float val) {
char *ptr = buffer;
while (ptr && *ptr && ptr < buffer + sofar) {
if (*ptr == code) {
return atof(ptr + 1);
}
ptr = strchr(ptr, ' ') + 1; // [B]<-- here he hangs up[/B]
}
return val;
}
//G-code parser end
Hope you can help me.
Best regards