Sign in

username:

password:



Not a member?

Search basicx



Search tips

Subscribe to basicx



basicx by Keywords

Accelerometer | ADC | ADXL | Adxl20 | AVR | BasicStamp | BX-35 | BX28 | BX35 | COM3 | Compiler | Downloader | EEPROM | Electromagnet | GetADC | GP2D1 | GPS | I2C | IDE | Keypad | LCD | LCD+ | MIDI | Motors | Multitasking | Netmedia | Networking | PCB | PID | PlaySound | PWM | Relays | RTC | Servo | ShiftOut | SitePlayer | SPI | Stack | Timer | USB

Ads

Discussion Groups

Discussion Groups | BasicX | BX24 Multitasking

Discussion forum for the BasicX family of microcontroller chips.

BX24 Multitasking - Author Unknown - Jan 3 22:13:00 2000

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





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )


Re: BX24 Multitasking - Jack Schoof - Jan 4 13:33:00 2000

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>
>
>------------------------------------------------------------------------





(You need to be a member of basicx -- send a blank email to basicx-subscribe@yahoogroups.com )