SparkFun Forums 

Where electronics enthusiasts find answers.

Tips and questions relating to the GPS modules from SFE
By fireball003
I need to read line, that is it will read the whole string when it will receive a '\n'.

But I couldn't find out any solution using SER.receive() , SER.receivebyte() and When I use SER.receive(timeout) or SER.receivebyte(timeout) then after timeout or after receiving first character it goes to next prompt.

Close one is with MOD.sleep(timeout). But say user enter data in the last moment of timeout or can not enter data within timeout period , then the data is scattered.

Anyone build readline() function? Any suggestion on how can I solve this ?

Thanks in advance.
By Jonek
Cant you just wait in a loop? Something like:
Code: Select all
r = SER.receive(20)
      r = r+SER.receive(20)