CON OSCMODE = $010c3f04 FREQ = 160_000_000 ' BAUD = 2*115200 delay = freq / 10 reset = 3 con obj ser: "FullDuplexSerial2" screen: "FullDuplexSerial2" pub main clkset (OSCMODE, FREQ) outa[reset]~ ''Reset uOLED dira[reset]~~ waitcnt(Clkfreq/16 + cnt) outa[reset]~~ dira[reset]~ 'waitcnt(Clkfreq * 2 + cnt) ser.start(63,62,0,230400) screen.start(0,1,0,115200) waitcnt(clkfreq/2+cnt) ser.str(string(10,13,"test")) waitcnt(clkfreq+cnt) clear waitcnt(clkfreq+cnt) width height hello waitcnt(clkfreq/2+cnt) clear waitcnt(clkfreq/2+cnt) movecursor teststring waitcnt(clkfreq/2+cnt) clear ' waitcnt(clkfreq+cnt) repeat filledrectangle($f8,$00)'red waitcnt(clkfreq/2+cnt) filledrectangle($07,$e0)'green waitcnt(clkfreq/2+cnt) outline filledrectangle($00,$1c)'blue waitcnt(clkfreq/2+cnt) clear POLYGONYELLOW waitcnt(clkfreq/2+cnt) clear ' outline triangle($f8,$00)'red waitcnt(clkfreq+cnt) clear triangle($07,$e0)'green waitcnt(clkfreq/2+cnt) clear triangle($00,$1c)'blue waitcnt(clkfreq/2+cnt) clear ' polygon waitcnt(clkfreq/2+cnt) clear 'polygon2 waitcnt(clkfreq/2+cnt) clear { polygon3($00,$32,$F0,$E0) waitcnt(clkfreq+cnt) clear polygon3($00,$3C,$07,$e0) waitcnt(clkfreq+cnt) clear polygon3($00,$46,$00,$1c) waitcnt(clkfreq+cnt){ clear 'x y rad color filledcircle($00,$3c,$00,$3c,$00,$23,$F8,$00) waitcnt(clkfreq+cnt) clear filledcircle($00,$3c,$00,$3c,$00,$23,$07,$e0) waitcnt(clkfreq+cnt) clear filledcircle($00,$3c,$00,$3c,$00,$23,$00,$1c) waitcnt(clkfreq+cnt) clear 'x y rad color filledcircle($00,$3c,$00,$3c,$00,$0a,$F8,$00) waitcnt(clkfreq+cnt) clear filledcircle($00,$3c,$00,$3c,$00,$14,$07,$e0) waitcnt(clkfreq+cnt) clear filledcircle($00,$3c,$00,$3c,$00,$1e,$00,$1c) waitcnt(clkfreq+cnt) clear rectangle($00,$0a,$00,$14,$00,$5a,$00,$3c,$F8,$00) waitcnt(clkfreq/2+cnt) clear rectangle($00,$0a,$00,$14,$00,$5a,$00,$3c,$07,$e0) waitcnt(clkfreq/2+cnt) clear rectangle($00,$0a,$00,$14,$00,$5a,$00,$3c,$00,$1c) waitcnt(clkfreq/2+cnt) clear circle($00,$3c,$00,$3c,$00,$0a,$F8,$00) waitcnt(clkfreq/2+cnt) clear circle($00,$3c,$00,$3c,$00,$14,$07,$e0) waitcnt(clkfreq/2+cnt) clear circle($00,$3c,$00,$3c,$00,$1e,$00,$1c) waitcnt(clkfreq/2+cnt) clear polyline($00,$0a,$00,$05,$00,$3c,$00,$50,$00,$78,$00,$5a,$ff,$00) ' red waitcnt(clkfreq/2+cnt) clear polyline($00,$0a,$00,$05,$00,$3c,$00,$50,$00,$78,$00,$5a,$07,$e0) waitcnt(clkfreq/2+cnt) clear polyline($00,$0a,$00,$05,$00,$3c,$00,$50,$00,$78,$00,$5a,$00,$1c) waitcnt(clkfreq/2+cnt) clear polygon($00,$0a,$00,$05,$00,$3c,$00,$50,$00,$78,$00,$5a,$ff,$00) waitcnt(clkfreq/2+cnt) clear polyline($00,$0a,$00,$05,$00,$3c,$00,$50,$00,$78,$00,$5a,$07,$e0) waitcnt(clkfreq/2+cnt) clear polyline($00,$0a,$00,$05,$00,$3c,$00,$50,$00,$78,$00,$5a,$00,$1c) waitcnt(clkfreq/2+cnt) clear clear pub clear screen.tx($FF) screen.tx($D7) pub blue screen.tx($FF) screen.tx($6E) screen.tx($00) screen.tx($10) 'screen.tx($3b) 'screen.tx($ff) pub green screen.tx($FF) screen.tx($6E) screen.tx($00) screen.tx($11) pub filledrectangle(COL0,COL1) 'FILLED RECTANGLE GREEN screen.tx($FF) screen.tx($CE) screen.tx($00) screen.tx(($0A)) screen.tx($00) screen.tx($14) screen.tx($00) screen.tx($5A) screen.tx($00) screen.tx($3C) screen.tx(COL0)'07 screen.tx(COL1)'E0 { pub rectangle(COL0,COL1) 'FILLED RECTANGLE GREEN screen.tx($FF) screen.tx($CE) screen.tx($00) screen.tx(($0A)) screen.tx($00) screen.tx($14) screen.tx($00) screen.tx($5A) screen.tx($00) screen.tx($3C) screen.tx(COL0)'07 screen.tx(COL1)'E0 } PUB hello '******************text background screen.tx($FF)'COMMAND screen.tx($7E) screen.tx($f8)'COLOR RED screen.tx($00) '****************TEXT BOLD screen.tx($FF) screen.tx($76) screen.tx($00) screen.tx($01) '****************ITALIC screen.tx($FF) screen.tx($75) screen.tx($00) screen.tx($01) '*************UNDERLINE screen.tx($FF) screen.tx($73) screen.tx($00) screen.tx($01) '************HELLO screen.tx($00)'PUTSTRING screen.tx($06) screen.tx($48) screen.tx($65) screen.tx($6c) screen.tx($6C) screen.tx($6F) screen.tx($00) ' screen.tx($1E) ' screen.tx($00) ' screen.tx($AF) '**************TEST '**************TEXT SIZE AND WIDTH pub width screen.tx($FF)'WIDTH screen.tx($7C) screen.tx($00) screen.tx($02) pub height '***********HEIGHT screen.tx($FF) screen.tx($7B) screen.tx($00) screen.tx($02) PUB TESTSTRING '******************text background screen.tx($FF)'COMMAND screen.tx($7E) screen.tx($Ff)'COLOR RED screen.tx($00) '**************TEXT SIZE AND WIDTH screen.tx($FF)'WIDTH screen.tx($7C) screen.tx($00) screen.tx($02) '***********HEIGHT screen.tx($FF) screen.tx($7B) screen.tx($00) screen.tx($02) '****************TEXT BOLD screen.tx($FF) screen.tx($76) screen.tx($00) screen.tx($01) '****************ITALIC screen.tx($FF) screen.tx($75) screen.tx($00) screen.tx($01) '*************UNDERLINE screen.tx($00)'PUTSTRING "TEST" screen.tx($06) screen.tx($54) screen.tx($45) screen.tx($53) screen.tx($54) ' screen.tx($6F) screen.tx($00) '54 45 53 54 '---------------MOVE CURSOR pub movecursor screen.tx($ff)'move cursor screen.tx($e4) screen.tx($00) screen.tx($05) screen.tx($00) screen.tx($03) 'screen.tx($03) '***************POLYGON pub POLYGONYELLOW 'FILLED RECTANGLE GREEN screen.tx($00) screen.tx($04) screen.tx($00) screen.tx(($03)) screen.tx($00) screen.tx($0A) screen.tx($00) screen.tx($3C) screen.tx($00) screen.tx($78) screen.tx($00) screen.tx($05) screen.tx($00) screen.tx($50) screen.tx($00) screen.tx($5A) screen.tx($FF) screen.tx($E0) pub triangle(col1,col2) 'FILLED RECTANGLE GREEN screen.tx($ff) screen.tx($c9) screen.tx($00) screen.tx(($00)) screen.tx($00) screen.tx($00) screen.tx($00) screen.tx($28) screen.tx($00) screen.tx($20) screen.tx($00) screen.tx($00) screen.tx($00) screen.tx($28) screen.tx(col1) screen.tx(col2) pub outline screen.tx($ff) screen.tx($67) screen.tx($f8) screen.tx($1f) { pub polygon 'FILLED TRIANGLE red screen.tx($00) screen.tx($04) screen.tx($00) screen.tx($03) screen.tx($00) screen.tx($0A)'X screen.tx($00) screen.tx($3C) screen.tx($00) screen.tx($78) screen.tx($00) screen.tx($05) screen.tx($00) screen.tx($50) screen.tx($00) screen.tx($5A) screen.tx($F0) screen.tx($E0)} pub polygon2 'FILLED TRIANGLE red screen.tx($00) screen.tx($04) screen.tx($00) screen.tx($03) screen.tx($00) screen.tx($1E)'X screen.tx($00) screen.tx($3C) screen.tx($00) screen.tx($78) screen.tx($00) screen.tx($05) screen.tx($00) screen.tx($50) screen.tx($00) screen.tx($5A) screen.tx($F0) screen.tx($E0) pub polygon3(x0,x1,col1,col2) ' TRIANGLE red screen.tx($00) screen.tx($04) screen.tx($00) screen.tx($03) screen.tx(x0) screen.tx(x1)'X screen.tx($00) screen.tx($3C) screen.tx($00) screen.tx($78) screen.tx($00) screen.tx($05) screen.tx($00) screen.tx($50) screen.tx($00) screen.tx($5A) screen.tx($F0) screen.tx($E0) pub filledcircle(x0,x1,y0,y1,rad0,rad1,col0,col1) ' red screen.tx($FF) screen.tx($CC) screen.tx(x0) screen.tx(x1) screen.tx(y0) screen.tx(y1) screen.tx(rad0) screen.tx(rad1) screen.tx(col0) screen.tx(col1) pub circle(x0,x1,y0,y1,rad0,rad1,col0,col1) ' red screen.tx($FF) screen.tx($CC) screen.tx(x0) screen.tx(x1) screen.tx(y0) screen.tx(y1) screen.tx(rad0) screen.tx(rad1) screen.tx(col0) screen.tx(col1) pub rectangle(x0,x1,y0,y1,X2,X3,y2,y3,col0,col1) ' red 'rectangle($00,$0a,$00,$14,$00,$5a,$00,$3c,$00,$1c) screen.tx($FF) screen.tx($CF) screen.tx(x0) screen.tx(x1) screen.tx(y0) screen.tx(y1) screen.tx(X2) screen.tx(X3) screen.tx(Y2) screen.tx(Y3) screen.tx(col0) screen.tx(col1) pub filledcircle(x0,x1,y0,y1,rad0,rad1,col0,col1) ' red screen.tx($FF) screen.tx($CC) screen.tx(x0) screen.tx(x1) screen.tx(y0) screen.tx(y1) screen.tx(rad0) screen.tx(rad1) screen.tx(col0) screen.tx(col1) pub circle(x0,x1,y0,y1,rad0,rad1,col0,col1) ' red screen.tx($FF) screen.tx($CD) screen.tx(x0) screen.tx(x1) screen.tx(y0) screen.tx(y1) screen.tx(rad0) screen.tx(rad1) screen.tx(col0) screen.tx(col1) ' x1 y1 x2 y2 x3 y3 'polyline($00,$0a,$00,$05,$00,$3c,$00,$50,$00,$78,$00,$5a,$ff,$00) ' red pub polyline(x0,x1,y0,y1,x2,x3,y2,y3,x4,x5,y4,y5,col1,col2) ' red screen.tx($00) screen.tx($05) screen.tx($00) screen.tx($03) screen.tx(x0) screen.tx(x1)'x1 screen.tx(y0) screen.tx(y1) screen.tx(x2)'y1 screen.tx(x3) screen.tx(y2) screen.tx(y3)'y2 screen.tx(x4) screen.tx(x5)'x3 screen.tx(y4) screen.tx(y5)'y3 screen.tx(col1) screen.tx(col2)'color ' x1 y1 x2 y2 x3 y3 'polygon($00,$0a,$00,$05,$00,$3c,$00,$50,$00,$78,$00,$5a,$ff,$00) ' red pub polygon(x0,x1,y0,y1,x2,x3,y2,y3,x4,x5,y4,y5,col1,col2) ' red screen.tx($00) screen.tx($04) screen.tx($00) screen.tx($03) screen.tx(x0) screen.tx(x1)'x1 screen.tx(y0) screen.tx(y1) screen.tx(x2)'y1 screen.tx(x3) screen.tx(y2) screen.tx(y3)'y2 screen.tx(x4) screen.tx(x5)'x3 screen.tx(y4) screen.tx(y5)'y3 screen.tx(col1) screen.tx(col2)'color