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 CCS Technical Support

How should I structure my code for this application?

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







How should I structure my code for this application?
PostPosted: Sun Oct 19, 2008 12:47 am     Reply with quote

I'm making a lock circuit that has 4 buttons: key1, Key2, Key3 and Enter Key.

It's a 3 combination lock and each number is entered by pressing key1, key2 or key3 and then enter key to unlock (if combo is right). For example, pressing key1 3 times, key2 one time and key3 6 times means that the combo is 3,1 and 6.

Also I want to design it so that If I hold the enter key for more than 6 sec, the lock will ask for my old combination before allowing me enter a new combination.

My question is what is the best way to structure the programming code for this application? What are some other code structures beside state machine?
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