anishpsla
Member level 2
- Joined
- Dec 15, 2013
- Messages
- 44
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 8
- Activity points
- 402
PIC16F877 Doing work for n sec in MikroC
In my project, I want to do a work for 'n' sec. I am using MikroC and PIC16F877.
For example,
After executing this, I want to wait up to 'n' sec. If there no reply even after 'n' sec, function Timeout() will execute. Please help me by giving code for the same.
In my project, I want to do a work for 'n' sec. I am using MikroC and PIC16F877.
For example,
Code C - [expand] 1 UART1_Write_Text('String')
After executing this, I want to wait up to 'n' sec. If there no reply even after 'n' sec, function Timeout() will execute. Please help me by giving code for the same.
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 // this loop waits for the answer do{ if(UART1_Data_Ready()){ response[x] = UART1_Read(); x++; // check if the desired answer is in the response of the module if (strstr(response, expected_answer1) != NULL) { answer = 1; } } // Waits for the asnwer with time out } while("not timeout");