Shop OBEX P1 Docs P2 Docs Learn Events
BS2P40 and the PIN type — Parallax Forums

BS2P40 and the PIN type

ArchiverArchiver Posts: 46,084
edited 2004-06-15 15:30 in General Discussion
How does one use a PIN type definition on the BS2P40's AUXIO pins?
This snippet:

MAINIO
Fred PIN 2
AUXIO
Wilma PIN 2
.
.
.
LOW Wilma
.
.
...

doesn't seem to work. Can AUX pins be addressed this way?

Thanx,
T.

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-06-14 22:54
    PIN works fine with the BS2p40. What's important to remember that the
    PIN definition is for the compiler and how it generates code underneath.


    I just ran this code on my NX-1000-24/40 board with a BS2p40 installed
    and it worked as expected:

    Fred PIN 0
    Wilma PIN 0

    Main:
    MAINIO
    HIGH Fred
    AUXIO
    HIGH Wilma
    PAUSE 500
    MAINIO
    LOW Fred
    AUXIO
    LOW Wilma
    PAUSE 500
    GOTO Main

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



    Original Message
    From: com120 [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=qteO2Pez_rShceEOQx1yCndDwN_-cu32SxXszINhX-O9VJzJx6kFNUPZfEnBmsRfgGgFlcDgupU3XDYe-GU]toad_koppel@y...[/url
    Sent: Monday, June 14, 2004 4:05 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] BS2P40 and the PIN type


    How does one use a PIN type definition on the BS2P40's AUXIO pins?
    This snippet:

    MAINIO
    Fred PIN 2
    AUXIO
    Wilma PIN 2
    .
    .
    .
    LOW Wilma
    .
    .
    ...

    doesn't seem to work. Can AUX pins be addressed this way?

    Thanx,
    T.
  • ArchiverArchiver Posts: 46,084
    edited 2004-06-15 15:30
    'AUXIO' (and MAINIO) is a compiler switch. You've
    tried to use it here to identify 'WILMA' as an
    AUXIO pin. That is not how it works.

    When you issue AUXIO, EVERY pin reference after that
    (i.e. further along in the source file) refers to the
    AUXIO I/O pins (until your next 'MAINIO',that is).
    When you issue 'MAINIO', every reference after that
    (until the next AUXIO) refers to the MAIN I/O pins.

    --- In basicstamps@yahoogroups.com, "com120" <toad_koppel@y...> wrote:
    > How does one use a PIN type definition on the BS2P40's AUXIO pins?
    > This snippet:
    >
    > MAINIO
    > Fred PIN 2
    > AUXIO
    > Wilma PIN 2
    > .
    > .
    > .
    > LOW Wilma
    > .
    > .
    > ...
    >
    > doesn't seem to work. Can AUX pins be addressed this way?
    >
    > Thanx,
    > T.
Sign In or Register to comment.