Timer and Serial Coms help
Zap-o
Posts: 452
I am trying to get this code to work. It seems that the timer is not activated.
i am using the fullDuplexSerial object and just want to set a timer up to move on.
Pub Getstring | TimerX, StringCount TimerX := Cnt StringCount := 0 Repeat Until ((SerialData[noparse][[/noparse] StringCount ] := Coms.rx) == ".") or ((Cnt - timerx) / (clkfreq / 1000) => 100) StringCount++
i am using the fullDuplexSerial object and just want to set a timer up to move on.
Comments
2) Your problem is that Coms.rx doesn't return until a character is available. You could use Coms.rxcheck which returns a -1 if there's no character available or you could use Coms.rxtime(100) which already does the timeout checking and returns -1 if there's a timeout.
-Phil
Update: Mike beat me to it with a much better suggestion.
Mike thanks for the code. Its opened my eyes. Seems I often overlook the obvious.