AUXIO - BASIC Stamp Command Reference
Demo Program (AUX_MAIN_TERM.bsp)
' This program demonstrates the use of the AUXIO, MAINIO and IOTERM commands to
' affect I/O pins in the auxiliary and main I/O groups.
'{$STAMP BS2p}
Port VAR
BIT
Loop:
MAINIO
TOGGLE 0
PWM 1, 100, 40
AUXIO
TOGGLE 0
PULSOUT 1, 1000
PWM 2, 100, 40
IOTERM Port
TOGGLE 3
Port = ~Port
PAUSE 1000
GOTO Loop
Page 82 • BASIC Stamp Programming Manual 2.0b • www.parallaxinc.com
'STAMP directive (specifies a BS2p)
'Switch to main I/O pins
'Toggle state of I/O pin 0 (physical pin 5)
'Generate PWM on I/O pin 1 (physical pin 6)
'Switch to auxiliary I/O pins
'Toggle state of I/O pin 0 (physical pin 21)
'Generate a pulse on I/O pin 1 (physical pin 22)
'Generate PWM on I/O pin 2 (physical pin 23)
'Switch to main or aux I/Os (depending on Port)
'Toggle state of I/O pin 3 (on main and aux, alternately)
'Invert port (switch between 0 and 1)
2
p
NOTE: This is written for the BS2p
but its effects can only be seen on
the 40-pin version: the BS2p40.
Need help?
Do you have a question about the BASIC Stamp 2e and is the answer not in the manual?