LOOKUP - BASIC Stamp Command Reference
Demo Program (LOOKDOWN.bas)
' This program uses Lookup to create a debug-window animation of a spinning propeller.
' The animation consists of the four ASCII characters | / - \ which, when printed rapidly
' in order at a fixed location, appear to spin. (A little imagination helps a lot here.)
'{$STAMP BS1}
SYMBOL
I
= B0
SYMBOL
Frame = B1
Rotate:
FOR I = 0 TO 3
LOOKUP I,("|/-\"),Frame
DEBUG CLS, @Frame
PAUSE 50
NEXT
GOTO Rotate
Demo Program (LOOKUP.bs2)
' This program uses Lookup to create a debug-window animation of a spinning propeller.
' The animation consists of the four ASCII characters | / - \ which, when printed rapidly
' in order at a fixed location, appear to spin. (A little imagination helps a lot here.)
'{$STAMP BS2}
I
VAR
NIB
Frame
VAR
BYTE
Rotate:
FOR I = 0 TO 3
LOOKUP I,["|/-\"],Frame
DEBUG HOME, Frame
PAUSE 50
NEXT
GOTO Rotate
Page 186 • BASIC Stamp Programming Manual 2.0b • www.parallaxinc.com
'STAMP directive (specifies a BS1)
'STAMP directive (specifies a BS2)
1
2
2
2
2
e
sx
p
NOTE: This is written for the BS2
but can be used for the BS2e,
BS2sx and BS2p also. Locate the
proper source code file or modify
the STAMP directive before
downloading to the BS2e, BS2sx or
BS2p.
Need help?
Do you have a question about the BASIC Stamp 2e and is the answer not in the manual?