Shop OBEX P1 Docs P2 Docs Learn Events
BS40p AUXIO/MAINIO — Parallax Forums

BS40p AUXIO/MAINIO

ArchiverArchiver Posts: 46,084
edited 2001-06-01 22:23 in General Discussion
I've a quick question regarding the BS40p 40 pin stamp with extra io
pins... I've read through the Basic Stamp v2 manual and it gives the
impression that you basically switch between the 2 sets of io pins
using AUXIO and MAINIO...does that mean that if (for example)

I have a switch and an LED connected to the AUXIO pins so that the
switch lights the led.. nice and simple.

I also have another switch and led connected to the MAINIO pins..

If I have NOT issued an AUXIO command in my program but press the
switch connected to the AUXIO pins the LED will NOT light.. in effect
the switch is ignored until I do an AUXIO.. similarly if I do have an
AUXIO command in my program until I then do a MAINIO command that LED
would not be affected ..

Is that a correct understanding?

Thanks

Andy

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2001-06-01 19:26
    [font=arial,helvetica]You have right. Check out the IOTERM term pbasic command. It is just like
    AUXIO and MANIO except it can be a constant or variable.
    Chuck[/font]
  • ArchiverArchiver Posts: 46,084
    edited 2001-06-01 22:23
    The LED will only come on when you look for the input
    from the switch, and not until you do, right? So just
    make sure you are looking for the right input. Try
    something like this:

    LOOP:
    MAINIO
    OUT4 = IN3 ' LED on 4, switch on 3
    AUXIO
    OUT4 = IN3 ' same on other side
    GOTO LOOP

    And since your dealing with two homogenous sides,
    another approach is:

    a VAR BIT
    a = 0
    LOOP:
    IOTERM a
    OUT4 = IN3
    a = ~a
    GOTO LOOP

    I have heterogenous pin configurations on the two
    sides, with all regular inputs on MAINIO, all serial
    inputs (shift registers and ADC's) on AUXIO, and some
    outputs on each side. I am trying to force myself to
    call out MAINIO or AUXIO before all I/O operations.
    IOTERM is only useful if the same pin numbers are used
    for identical purposes on both sides, but then it is
    extremely useful.

    Bob Pence


    --- andy_powell_is@y... wrote:
    > I've a quick question regarding the BS40p 40 pin
    > stamp with extra io
    > pins... I've read through the Basic Stamp v2 manual
    > and it gives the
    > impression that you basically switch between the 2
    > sets of io pins
    > using AUXIO and MAINIO...does that mean that if (for
    > example)
    >
    > I have a switch and an LED connected to the AUXIO
    > pins so that the
    > switch lights the led.. nice and simple.
    >
    > I also have another switch and led connected to the
    > MAINIO pins..
    >
    > If I have NOT issued an AUXIO command in my program
    > but press the
    > switch connected to the AUXIO pins the LED will NOT
    > light.. in effect
    > the switch is ignored until I do an AUXIO..
    > similarly if I do have an
    > AUXIO command in my program until I then do a MAINIO
    > command that LED
    > would not be affected ..
    >
    > Is that a correct understanding?
    >
    > Thanks
    >
    > Andy
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed
    > with. Text in the Subject and Body of the message
    > will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    __________________________________________________
    Do You Yahoo!?
    Get personalized email addresses from Yahoo! Mail - only $35
    a year! http://personal.mail.yahoo.com/
Sign In or Register to comment.