EASy68K  
It is currently Fri Jun 05, 2020 3:30 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Push button and delay
PostPosted: Wed Aug 18, 2010 4:31 am 
Offline
User avatar

Joined: Mon Aug 16, 2010 3:16 pm
Posts: 22
Hello, I have another question here. As I know, in this programming, the command will be executed one by one. however, now i am required to press the Push Button within 20 seconds. while the delay for 20 seconds is running, i cannot do another command. may i know how to write the code so that within that 20 seconds, i still can press the Push Button? in short, let's say the Push Button is a password, so within 20 seconds, I have to press the correct Push Button, else the siren will be activated. If the Push button is right, then it will go to the next step.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 18, 2010 1:12 pm 
Offline
User avatar

Joined: Thu Dec 16, 2004 6:42 pm
Posts: 1122
If you need to interrupt the delay then trap task #23 may not be used for the entire delay time. Write a loop and put a delay of 1/100 seconds inside the loop. Use the number of loops to control the total time delay.

_________________
Prof. Kelly


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 18, 2010 4:37 pm 
Offline
User avatar

Joined: Mon Aug 16, 2010 3:16 pm
Posts: 22
thanks. but i am not very sure on how to write the code for it. can you please explain it in more detail? besides, can i have some basic instruction on how to use Push Button, for example, like if LED0 and LED1 is ON, i need to press the Push Button 0 and 1 to go to next step, if not, i will loop until the correct Push Button is pressed. thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 18, 2010 8:27 pm 
Offline

Joined: Mon Jul 26, 2010 11:43 pm
Posts: 198
Location: Aurora, IL
You should be able to do some bit tests and branching based on the state of the LEDs and BUTTONs. Try doing a flow chart or state diagram, if the ordering and desired results are confusing.

There are plenty of books on programming the 68000, there are several by Leventhal,Kane,Hawkins which might provide the kind of example code you are looking for. Some are out of print, but have good availability in the used market via Amazon, Alibris, etc.

Check with your coursework, or suggested reading list.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 28, 2010 5:43 am 
Offline
User avatar

Joined: Mon Aug 16, 2010 3:16 pm
Posts: 22
thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 8 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group