' {$STAMP BS2} '************************************************************************ '* Basic Stamp Activity Board Display Demonstration Program * '* * '* 21 April 2005 (BS-2) * '* * '************************************************************************ DIRS = %0001000000000000 ' Set direction for all bits x VAR Byte y VAR Byte z VAR Byte kount VAR Byte mode VAR Byte SerString VAR Byte(10) ' Reset CS-2B SEROUT 14,84,["R",CR] GOSUB wait_char ' Wait for command response ' Give it time to reset PAUSE 1000 SEROUT 14,84,["W0",CR] GOSUB wait_char ' Wait for command response ' Give it time to reset PAUSE 100 ' Set pin 15 to rs-232 input SERIN 15,84,10,wait_start,[WAIT(">")] ' Send carriage returns until CS-2B responds wait_start: SEROUT 14,84,[CR] SERIN 15,84,1000,wait_start,[WAIT(">")] ' Turn off the echo SEROUT 14,84,["EX",CR] GOSUB wait_char ' Wait for command response DEBUG "Start",CR ' Starting display SEROUT 14,84,["[M",CR]' Starting screen GOSUB wait_char ' Wait for command response PAUSE 2000 SEROUT 14,84,["[N",CR] ' Fonts screen GOSUB wait_char ' Wait for command response SEROUT 14,84,["th21,S",CR] ' Capital S GOSUB wait_char ' Wait for command response SEROUT 14,84,["tm35,Huge",CR] ' Capital S GOSUB wait_char ' Wait for command response PAUSE 750 SEROUT 14,84,["tl26,T",CR] ' Capital T GOSUB wait_char ' Wait for command response SEROUT 14,84,["tm57,Large",CR] ' Capital T GOSUB wait_char ' Wait for command response PAUSE 750 SEROUT 14,84,["tm77,O",CR] ' Capital O GOSUB wait_char ' Wait for command response SEROUT 14,84,["ts711,Medium",CR] ' Capital O GOSUB wait_char ' Wait for command response PAUSE 750 SEROUT 14,84,["ts811,P Small",CR] ' Capital P GOSUB wait_char ' Wait for command response PAUSE 2000 SEROUT 14,84,["[O",CR] ' Graphics screen GOSUB wait_char ' Wait for command response ' Lines B1 = 10 B2 = 3 FOR B0 = 1 TO 12 SEROUT 14,84,["L0,63,",DEC B1,",",DEC B2,CR] ' Lines GOSUB wait_char ' Wait for command response SEROUT 14,84,["L127,0,",DEC B1,",",DEC B2,CR] ' Lines GOSUB wait_char ' Wait for command response B1 = B1 + 10 B2 = B2 + 3 NEXT PAUSE 1000 SEROUT 14,84,["[O",CR] ' Graphics screen - boxes GOSUB wait_char ' Wait for command response SEROUT 14,84,["LB5,5,50,15",CR] ' Box GOSUB wait_char ' Wait for command response SEROUT 14,84,["LB27,10,120,25",CR] ' Box GOSUB wait_char ' Wait for command response SEROUT 14,84,["LB54,22,90,46",CR] ' Box GOSUB wait_char ' Wait for command response PAUSE 1000 SEROUT 14,84,["[O",CR] ' Graphics screen - filled boxes GOSUB wait_char ' Wait for command response SEROUT 14,84,["LBF5,5,50,15",CR] ' Filled Box GOSUB wait_char ' Wait for command response SEROUT 14,84,["LBF27,10,120,25",CR] ' Filled Box GOSUB wait_char ' Wait for command response SEROUT 14,84,["LBF54,22,90,46",CR] ' Filled Box GOSUB wait_char ' Wait for command response PAUSE 1000 SEROUT 14,84,["L#BF10,10,60,20",CR] ' Filled Box GOSUB wait_char ' Wait for command response SEROUT 14,84,["L#BF32,15,125,30",CR] ' Filled Box GOSUB wait_char ' Wait for command response SEROUT 14,84,["L*BF59,27,95,49",CR] ' Filled Box GOSUB wait_char ' Wait for command response PAUSE 1000 SEROUT 14,84,["[O",CR] ' Graphics screen - circles GOSUB wait_char ' Wait for command response B1 = 10 B2 = 3 B3 = 5 FOR B0 = 1 TO 10 SEROUT 14,84,["O",DEC B1,",",DEC B2,",",DEC B3,CR] ' Circles GOSUB wait_char ' Wait for command response B1 = B1 + 10 B2 = B2 + 3 B3 = B3 + 2 NEXT PAUSE 1000 ' Digital plots SEROUT 14,84,["[P",CR] ' Digital plots GOSUB wait_char ' Wait for command response FOR B0 = 1 TO 240 SEROUT 14,84,["PD",DEC B0,CR] ' Circles GOSUB wait_char ' Wait for command response PAUSE 20 NEXT PAUSE 2000 ' Analog plots SEROUT 14,84,["[Q",CR] ' Digital plots GOSUB wait_char ' Wait for command response FOR B0 = 1 TO 240 SEROUT 14,84,["PA",DEC B0,CR] ' Circles GOSUB wait_char ' Wait for command response PAUSE 20 NEXT PAUSE 2000 SEROUT 14,84,["R",CR] GOSUB wait_char ' Wait for command response END wait_char: ' Use the following command if you do not have ' pin 13 connected to the flow control pin ' of the display module ' SERIN 15,84,1000,wait_timeout,[WAIT(">")] PAUSE 3 IF IN13 = 0 THEN wait_char RETURN '**********************************************************************