Shop OBEX P1 Docs P2 Docs Learn Events
Assigning an Auxio pin as a constant — Parallax Forums

Assigning an Auxio pin as a constant

GeekgirlGeekgirl Posts: 50
edited 2010-05-31 17:58 in BASIC Stamp
Hi Team,

It's probably something simple that I overlooked, but I'd like to be able to use a constant to refer to an Auxilliary pin on the p40.

I added a second Ds1867 digital pot to a circuit that has·all the main·IO pins used already and would like to have the second DS1867 configured like the first:

The first one is configured:····Rst1··· ·CON·· 1

I'd like the second one:······· ·Rst2···· CON·· Aux10

The subroutine for·the first·DS1867 just uses: ·HIGH Rst1·· /· LOW Rst1

I'd like to be able to use: ·HIGH Rst2 ·/ ·LOW Rst2··· for the subroutine for the second, (and any additional) DS1867 as well

As it is, I can work around the issue with:· ·AUXIO : HIGH 10 :MAINIO /··AUXIO :·LOW 10 :MAINIO·· for the second 1867


but it would be nice, especially for future use, to know how to set an Aux pin as a constant.


Thanks in advance,

Darlene

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-05-31 17:58
    Use the PIN declaration for I/O pins. It gives the declared name two values. One is the pin number and the other is an internal definition that works out to INn and OUTn. You still have to use AUXIO and MAINIO since there are effectively only 16 I/O pins (at a time).

    As far as your program is concerned, there are only 16 I/O pins and there's no automatic way to switch between the two sets of 16.
Sign In or Register to comment.