Specifications
BASIC Stamp II
Parallax, Inc. • BASIC Stamp Programming Manual 1.8 • Page 297
2
for trials = 1 to 100 ' 100 tosses of the coin.
hold:
RANDOM flip ' While waiting for button,
randomize.
button 7,0,250,100,btn,0,hold ' Wait for button.
branch coin,[head,tail] ' If 0 then head; if 1 then tail.
head:
debug cr,"HEADS" ' Show heads.
heads = heads+1 ' Increment heads counter.
goto theNext ' Next flip.
tail:
debug cr,"TAILS" ' Show tails.
tails = tails+1 ' Increment tails counter.
theNext: ' Next flip.
next
' When done, show the total number of heads and tails.
debug cr,cr,"Heads: ",dec heads," Tails: ",dec tails
Figure I-13
+5V
10k
pin 7










