May anyone advise me on why code on chip stops executing whenever it reaches a line with a getc() function. Do I need to include some libraries specifically for an 18F because with a 16F my code run smoothly on chip.
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Tue Nov 08, 2011 8:56 pm
getc() waits for a character to be available, then it gets the character.
If you don't want to wait, then call kbhit(). It will check if a character
is available. If it is, then you can call getc(). If not, don't call it.
Read about these functions in the CCS manual:
http://www.ccsinfo.com/downloads/ccs_c_manual.pdf
The getc() function operates exactly the same way for 16F and 18F.
So does kbhit().
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum