EasyManua.ls Logo

Parallax BASIC Stamp 2e - Page 84

Default Icon
353 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
AUXIO - BASIC Stamp Command Reference
Page 82 BASIC Stamp Programming Manual 2.0b www.parallaxinc.com
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} 'STAMP directive (specifies a BS2p)
Port VAR BIT
Loop:
MAINIO 'Switch to main I/O pins
TOGGLE 0 'Toggle state of I/O pin 0 (physical pin 5)
PWM 1, 100, 40 'Generate PWM on I/O pin 1 (physical pin 6)
AUXIO 'Switch to auxiliary I/O pins
TOGGLE 0 'Toggle state of I/O pin 0 (physical pin 21)
PULSOUT 1, 1000 'Generate a pulse on I/O pin 1 (physical pin 22)
PWM 2, 100, 40 'Generate PWM on I/O pin 2 (physical pin 23)
IOTERM Port 'Switch to main or aux I/Os (depending on Port)
TOGGLE 3 'Toggle state of I/O pin 3 (on main and aux, alternately)
Port = ~Port 'Invert port (switch between 0 and 1)
PAUSE 1000
GOTO Loop
p
2
NOTE: This is written for the BS2p
but its effects can only be seen on
the 40-pin version: the BS2p40.

Table of Contents

Related product manuals