Specifications
BASIC Stamp I and Stamp II Conversions
Page 440 • BASIC Stamp Programming Manual 1.8 • Parallax, Inc.
May be converted to the following code:
Value VAR BYTE 'Value to be shifted out
CLK CON 0 'Clock pin is pin 0
DATA CON 1 'Data pin is pin 1
DIRS = %0000000000000011 'Set Clock and Data pins as
'outputs
Value = 125
SHIFTOUT DATA, CLK, MSBFIRST, [Value\8] 'Note that value is still intact
'after were done shifting
CONVERSION: BS1 Q BS2
Code such as the following:
Value VAR BYTE 'Value to be shifted out
CLK CON 0 'Clock pin is pin 0
DATA CON 1 'Data pin is pin 1
DIRS = %0000000000000011 'Set Clock and Data pins as
'outputs
Value = 220
SHIFTOUT DATA, CLK, LSBFIRST, [Value\8] 'Note that value is still intact
'after were done shifting
May be converted to the following code:
SYMBOL Count = B1 'Counter variable
SYMBOL CLK = 0 'Clock pin is pin 0
SYMBOL DATA = PIN1 'Data pin is pin 1
DIRS = %00000011 'Set Clock and Data pins as
'outputs
B0 = 220 'Value to be shifted out
FOR Count = 1 TO 8
DATA = BIT0 'Send out LSB of B0
PULSOUT CLK,1 'Clock the data
B0 = B0 / 2 'Shift the value left; note that
'the value is lost after were
'done
NEXT Count 'shifting










