CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Taking keyboard input

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
misel0019



Joined: 04 Oct 2010
Posts: 53
Location: Dhaka

View user's profile Send private message Send e-mail

Taking keyboard input
PostPosted: Wed Oct 27, 2010 12:05 am     Reply with quote

I need to take a keyboard input but I can't use getch(); because I wanna start a counter. If counter exceeds it will not wait for the keyboard.

I give you the image of flowchart.

Means the circuit may attach with pc or not. While attach with pc it will wait 5sec to take keyboard input. If input ok then go to main program or wait 5sec and seek for input. If 5sec is over it also goes to main.

Any suggestion.

Regards
Misel
misel0019



Joined: 04 Oct 2010
Posts: 53
Location: Dhaka

View user's profile Send private message Send e-mail

flowchart
PostPosted: Wed Oct 27, 2010 12:12 am     Reply with quote

http://yfrog.com/55flowp
flowchart is here
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Wed Oct 27, 2010 4:31 am     Reply with quote

Use kbhit() to see if a character is coming in. Only if there is a character call getc(), else count time. If you use a software UART you must call kbhit() at least 10 times the serial bit rate to make sure you don't miss the first bit from the keyboard. For a hardware UART you have up to 2 character lengths to catch the character.
_________________
The search for better is endless. Instead simply find very good and get the job done.
misel0019



Joined: 04 Oct 2010
Posts: 53
Location: Dhaka

View user's profile Send private message Send e-mail

reply
PostPosted: Wed Oct 27, 2010 10:42 pm     Reply with quote

thanks for the reply

trying to do that
misel0019



Joined: 04 Oct 2010
Posts: 53
Location: Dhaka

View user's profile Send private message Send e-mail

Thanks
PostPosted: Fri Oct 29, 2010 11:28 pm     Reply with quote

thanks SherpaDoug for your suggestion.
misel0019



Joined: 04 Oct 2010
Posts: 53
Location: Dhaka

View user's profile Send private message Send e-mail

thanks
PostPosted: Fri Oct 29, 2010 11:29 pm     Reply with quote

thanks it works
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group