' {$STAMP BS2} ' {$PBASIC 2.5} ' {$PORT COM1} '=================================================================================================== '================Programme to test the BOB4 Graphics overlay module================================= ' By John Smith 2007 '===============================constants=========================================================== bob CON 3 'Output pin to bob4 p3 on serial cable baud CON 16468 'Baud rate for 9600baud 8 N 1 BS2/E/PE 'baud2 CON 16624 'Baud rate for 9600baud 8 N 1 BS2 SX/P hold CON 250 'default 1750 '==================================Variables======================================================== csi VAR Byte(2) 'Control Sequence Introducer = ESC,[ font VAR Byte(2) 'font row VAR Byte 'row position variable col VAR Byte 'column position variable counter1 VAR Byte 'General purpose counter counter2 VAR Byte 'General purpose counter '==================================== Start of programme============================================ csi(0) = 27 'esc csi(1) = 91 '[ font = 0 'bob3 lookalike font row = 1 'set row start col = 1 'set column start PAUSE 1000 'one second pause 'Section one SEROUT bob,baud,[STR csi\2,"20;0v"] 'set display to 320 x 240 (Widescreen)'SEROUT bob,baud,[STR csi\2,"20;1v"] 'set display to 384 x 288 'SEROUT bob,baud,[STR csi\2,"20;1v"] 'set display to 384 x 288 'SEROUT bob,baud,[STR csi\2,"20;2v"] 'set display to 480 x 240 'SEROUT bob,baud,[STR csi\2,"20;3v"] 'set display to 480 x 288 SEROUT bob,baud,[STR csi\2,"0m"] 'clear display settings SEROUT bob,baud,[STR csi\2,"2,J"] ' clear screen main: FOR counter1 = 1 TO 15 SEROUT bob,baud,[STR csi\2,DEC font,"z"] 'select font 0 to 7 SEROUT bob,baud,[STR csi\2,DEC row,";", DEC col,"H"] 'position cursor row3 column8 SEROUT bob,baud,["Row=",DEC row," Col=", DEC col," Font=",DEC font] 'position cursor row3 column8 PAUSE hold row = row + 1 NEXT row = 1 font = font + 1 SEROUT bob,baud,[STR csi\2,"0m"] ' clear display settings SEROUT bob,baud,[STR csi\2,"2,J"] 'clear screen IF font = 7 THEN font = 0 GOTO section2 ENDIF GOTO main section2: PAUSE hold SEROUT bob,baud,[STR csi\2,"0z"] 'restore 0 font SEROUT bob,baud,[STR csi\2,"32;1v"] 'enable blink mode? SEROUT bob,baud,[STR csi\2,"3;7H"] 'position cursor row column SEROUT bob,baud,[STR csi\2,"1m"] 'start bold type SEROUT bob,baud,[" Bold Text"] 'type text " between question marks " SEROUT bob,baud,[STR csi\2,"22m"] 'stop bold setting SEROUT bob,baud,[STR csi\2,"5;7H"] 'position cursor row column SEROUT bob,baud,[STR csi\2,"2m"] 'start faint type SEROUT bob,baud,[" Faint Text"] 'type text " between question marks " SEROUT bob,baud,[STR csi\2,"22m"] 'stop faint setting SEROUT bob,baud,[STR csi\2,"7;7H"] 'position cursor row column SEROUT bob,baud,[STR csi\2,"5m"] 'start blinking type SEROUT bob,baud,[" Blinking Text"] 'type text " between question marks " SEROUT bob,baud,[STR csi\2,"25m"] 'stop blinking setting SEROUT bob,baud,[STR csi\2,"9;7H"] 'position cursor row column SEROUT bob,baud,[STR csi\2,"7m"] 'start Reverse video type SEROUT bob,baud,[" Reverse Video Text"] 'type text " between question marks " SEROUT bob,baud,[STR csi\2,"27m"] 'stop reverse setting PAUSE 2000'hold section3: SEROUT bob,baud,[STR csi\2,"2,J "] 'clear screen SEROUT bob,baud,[STR csi\2,"0z"] 'restore 1 font SEROUT bob,baud,[STR csi\2,"25m"] SEROUT bob,baud,[STR csi\2,"0;7H"] 'position cursor row column SEROUT bob,baud,[STR csi\2,"64m"] 'start bold type SEROUT bob,baud,[" Sixty four mode"] 'type text " between question marks " SEROUT bob,baud,[STR csi\2,"1;7H"] 'position cursor row column SEROUT bob,baud,[STR csi\2,"65m"] 'start faint type SEROUT bob,baud,[" Sixty Five Mode"] 'type text " between question marks " SEROUT bob,baud,[STR csi\2,"2;7H"] 'position cursor row column SEROUT bob,baud,[STR csi\2,"66m"] 'start blinking type SEROUT bob,baud,[" Sixty Six Mode"] 'type text " between question marks " SEROUT bob,baud,[STR csi\2,"3;7H"] 'position cursor row column SEROUT bob,baud,[STR csi\2,"67m"] 'start Reverse video type SEROUT bob,baud,[" Sixty Seven Mode"] 'type text " between question marks " SEROUT bob,baud,[STR csi\2,"4;7H"] 'position cursor row column SEROUT bob,baud,[STR csi\2,"68m"] 'start bold type SEROUT bob,baud,[" Sixty Eight Mode"] 'type text " between question marks " SEROUT bob,baud,[STR csi\2,"5;7H"] 'position cursor row column SEROUT bob,baud,[STR csi\2,"69m"] 'start faint type SEROUT bob,baud,[" Sixty Nine Mode"] 'type text " between question marks " SEROUT bob,baud,[STR csi\2,"6;7H"] 'position cursor row column SEROUT bob,baud,[STR csi\2,"70m"] 'start blinking type SEROUT bob,baud,[" Seventy Mode"] 'type text " between question marks " SEROUT bob,baud,[STR csi\2,"7;7H"] 'position cursor row column SEROUT bob,baud,[STR csi\2,"71m"] 'start Reverse video type SEROUT bob,baud,[" Seventy One Mode"] 'type text " between question marks " SEROUT bob,baud,[STR csi\2,"8;7H"] 'position cursor row column SEROUT bob,baud,[STR csi\2,"72m"] 'start bold type SEROUT bob,baud,[" Seventy Two Mode"] 'type text " between question marks " SEROUT bob,baud,[STR csi\2,"9;7H"] 'position cursor row column SEROUT bob,baud,[STR csi\2,"73m"] 'start faint type SEROUT bob,baud,[" Seventy Three Mode"] 'type text " between question marks " SEROUT bob,baud,[STR csi\2,"10;7H"] 'position cursor row column SEROUT bob,baud,[STR csi\2,"74m"] 'start blinking type SEROUT bob,baud,[" Seventy Four Mode"] 'type text " between question marks " SEROUT bob,baud,[STR csi\2,"11;7H"] 'position cursor row column SEROUT bob,baud,[STR csi\2,"75m"] 'start Reverse video type SEROUT bob,baud,[" Seventy Five Mode"] 'type text " between question marks " SEROUT bob,baud,[STR csi\2,"12;7H"] 'position cursor row column SEROUT bob,baud,[STR csi\2,"76m"] 'start bold type SEROUT bob,baud,[" Seventy Six Mode"] 'type text " between question marks " SEROUT bob,baud,[STR csi\2,"13;7H"] 'position cursor row column SEROUT bob,baud,[STR csi\2,"77m"] 'start faint type SEROUT bob,baud,[" Seventy Seven Mode"] 'type text " between question marks " SEROUT bob,baud,[STR csi\2,"14;7H"] 'position cursor row column SEROUT bob,baud,[STR csi\2,"78m"] 'start blinking type SEROUT bob,baud,[" Seventy Eight Mode"] 'type text " between question marks " SEROUT bob,baud,[STR csi\2,"15;7H"] 'position cursor row column SEROUT bob,baud,[STR csi\2,"79m"] 'start Reverse video type SEROUT bob,baud,[" Seventy Nine Mode "] 'type text " between question marks " SEROUT bob,baud,[STR csi\2,"0;0H"] 'position cursor row column PAUSE hold * 5 SEROUT bob,baud,[STR csi\2,"0m"] ' clear display settings SEROUT bob,baud,[STR csi\2,"2,J"] 'clear screen font = 0 'bob3 lookalike font row = 1 'set row start col = 2 'set column start GOTO main STOP