Shop OBEX P1 Docs P2 Docs Learn Events
i''m new, need help with command — Parallax Forums

i''m new, need help with command

ArchiverArchiver Posts: 46,084
edited 2004-02-10 16:02 in General Discussion
500 milliseconds is forever in microcontroller terms, especially in a
small tight loop. So long as you can ignore other inputs while you're
processing what's currently active, you won't have any troubles. If
input processing is short, you can even structure it like this:

Main:
DO
IF (Button1 = 1) THEN
' button 1 instructions
ENDIF

IF (Button2 = 1) THEN
' button 2 instructions
ENDIF

' more button checking

LOOP

-- Jon Williams
-- Applications Engineer, Parallax
-- Dallas Office



Original Message
From: andy_watson5 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=39J3qxaxW5Ncc-Wya_9g7RPM-l08meV-gA6xMKzhqb_fknhsx0KeeowydZvna6jf1n5MEuDtec7eGlgg]andywatson@m...[/url
Sent: Tuesday, February 10, 2004 9:58 AM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] Re: i'm new, need help with command


Well, by "quick", I mean that the pin will only be high for maybe 0.5
seconds. Assuming that the only thing going is the loop looking for
a high on one of the 4 pins, I don't know if that 0.5 sec high is
long enough. Perhaps I could add some kind of RC circuit to keep the
pin latched for an extra second or so. The POLLMODE latching stuff
looks a little more complicated. But if it's that much better, I'll
try to figure it out.

Thanks,
Andy
Sign In or Register to comment.