Table 5.40: MAINIO Quick Facts.
A
MAINIO
SIMPLE
EXAMPLE
5: BASIC Stamp Command Reference – MAINIO
MAINIO
2
MAINIO
p
Function
Switch from control of auxiliary I/O pins to main I/O pins (on the BS2p40
only).
Quick Facts
I/O pin IDs
Special notes
Explanation
The BS2p is available in two module styles, 1) a 24-pin module (called the
BS2p24) that is pin compatible with the BS2, BS2e and BS2sx and 2) a 40-
pin module (called the BS2p40) that has an additional 16 I/O pins (for a
total of 32). The BS2p40's extra, or auxiliary, I/O pins can be accessed in
the same manner as the main I/O pins (by using the IDs 0 to 15) but only
after issuing a command called AUXIO or IOTERM.
command causes the BASIC Stamp to affect the main I/O pins (the
default) instead of the auxiliary I/O pins in all further code until the
AUXIO or IOTERM command is reached, or the BASIC Stamp is reset or
power-cycled.
The following example illustrates this:
.
AUXIO
HIGH 0
MAINIO
LOW 0
The first line of the above example will tell the BASIC Stamp to affect the
auxiliary I/O pins in the commands following it. Line 2, sets I/O pin 0 of
the auxiliary I/O pins (physical pin 21) high. Afterward, the MAINIO
command tells the BASIC Stamp that all commands following it should
affect the main I/O pins. The last command, LOW, will set I/O pin 0 of
the main I/O pins (physical pin 5) low.
BS1
BS2
BS2e BS2sx
0 – 15 (just like auxiliary I/O, but after MAINIO command, all references
affect physical pins 5 – 20).
Both the BS2p24 and the BS2p40 accept this command, however,
only the BS2p40 gives access to the auxiliary I/O pins.
BASIC Stamp Programming Manual 2.0c • www.parallaxinc.com • Page 189
BS2p
BS2p
The MAINIO
Need help?
Do you have a question about the BASIC Stamp 2e and is the answer not in the manual?