reason is simple... serin hserin serin2 will wait untill they receive at least the number of variable or character you decide to receive... once they receive, you'll be able to jump to your button statement. BUT you can use a timeout label to exit serin after xyz time and proceed to another statement and do a loop. be carefull with that. other statement must not take too much time and you time out label should not be too small too. If so, you have chance to miss or have strange result when receiving data.
If your PIC have USART, a great way is to use the USART interrupt.
OR using kinda flow control. One specific interrupt pin that tell to your PIC that data is knocking on your PIC's door. This pin make your program jump to your serial data reception.
Last edited by mister_e; - 24th February 2005 at 12:50.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks