Discussion forum for the BasicX family of microcontroller chips.
|
I cannot figure this out, can someone please help... I want a program that monitors a button and if it is not pressed within 15 seconds, it goes to another subroutine thanks for any help! Alex Channell |
|
|
|
const buttonpin as byte = 12 dim i as integer sub main() for i = 1 to 1536 ' we assume the button is 0 when pressed if getpin(buttonpin) = 0 then 'go do whatever you want when pressed end if call sleep(5) 'sleeps for 5/512ths of a second ' so after 1536 times through this loop, it will be 15 seconds next 'if you fall out of this loop, then it has been 15 seconds without a button press end sub -----Original Message----- From: <> To: <> Date: Monday, January 03, 2000 9:24 PM Subject: [BasicX] BX24 Multitasking >From: > >I cannot figure this out, can someone please help... >I want a program that monitors a button and if it is not pressed within 15 seconds, it goes to another subroutine thanks for any help! > >Alex Channell > >--------------------------- ONElist Sponsor ---------------------------- > >Independent contractors: Find your next project gig through JobSwarm! > You can even make money by referring friends. ><a href=" http://clickme.onelist.com/ad/jobswarm2 ">Click Here</a> > >------------------------------------------------------------------------ |