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 03:44 in General Discussion
I'm new to Basic Stamps. I've written lots of code, mainly C++ and a
little Basic years ago. I'm trying to write a program and I'm
stuck. I've got the main part of my program written, but I need help
getting switch inputs to trigger subroutines.

Here's a basic description of my circuit: A user can press one of 4
momentary switches, labeld A, B, C, and D. Pressing the A buttons
will cause the program to go into the A subroutine, pressing the B
button goes into the B subroutine, and so forth.

I just can't figure out how to make the program look for these
triggers. I want the stamp to be continuously looking for one of the
4 inputs. I originally thought POLLIN would work, but I can't find a
way for it to distinquish which button was pressed. And since it's
just a momentary pulse coming from the switch, I can't think of what
else to use.

Does anyone have any suggestions? By the way, it's a BS2p40, because
I have 20 I/O elements for this program.

Thanks for any help you might be able to offer.
Sign In or Register to comment.