' to disconnect socket
html ||
guioff
W = 320
H = 170
start:
tft.rotation(3)
timer 0
tft.fill(tft.rgb(70, 130, 180))
color = tft.rgb(0, 0, 0)
'tft.line(0,0,100,200,color)
for r = 2 to W/2 step 4
tft.circle(W/2,H/2,r,color)
next
gosub pause
gosub testLines
gosub testFastLines
gosub testTriangles
gosub testFilledTriangles
gosub testRects
gosub testFilledRects
gosub testFilledCircles
gosub testCircles
gosub testRoundRects
tft.fill(tft.rgb(70, 130, 180))
tft.text.color(0)
tft.text.size(2)
tft.text.font(1)
for i = 0 to 5
tft.rotation(i)
tft.text.cursor(8,30)
tft.println("espBASIC ")
tft.println("on ESP32-S3 ")
delay 100
tft.fill(tft.rgb(70, 130, 180))
next
tft.text.color(tft.rgb(255,255,0))
tft.text.cursor(0,50)
tft.text.size(2)
tft.print("This is ")
tft.println("print ")
tft.println("second line")
tft.println("third line")
delay 2000
tft.rotation(3)
tft.text.size(1)
tft.text.font(1)
tft.cls()
RED = tft.rgb(255,0,0)
YELLOW = tft.rgb(255,255,0)
ORANGE = TFT.rgb(255,127,0)
' Left BOX
tft.srect.round.fill(1, 1, 76, 110, 4, 65535, 0)
tft.srect.round.fill(2, 2, 74, 108, 4, 0, 65535)
TFT.circle.fill(45,40,20,RED)
x = 3
y = 3
for i = x to x+70 step 2
tft.line(x,y,i,108,ORANGE)
next i
tft.text.font(1)
tft.text.color(YELLOW)
tft.text.cursor(0,60+20)
tft.println(" Mini-")
tft.println(" Radio-")
tft.println(" Scripting")
s = upper("MiniRadioScript ")
'timer 3000,start
'wait
end
testLines:
color = tft.rgb(0,255,255)
w = 240
h = 320
tft.fill(0)
x1 = 0
y1 = 0
y2 = H - 1
for x2 = 0 to w step 6
tft.line(x1, y1, x2, y2, color)
next
x2 = W - 1
for y2 = 0 to H step 6
tft.line(x1, y1, x2, y2, color)
next
tft.fill(0)
x1 = W - 1
y1 = 0
y2 = H - 1
for x2 = 0 to W step 6
tft.line(x1, y1, x2, y2, color)
next
x2 = 0
for y2 = 0 to H step 6
tft.line(x1, y1, x2, y2, color)
next
tft.fill(0)
x1 = 0
y1 = H - 1
y2 = 0
for x2 = 0 to W step 6
tft.line(x1, y1, x2, y2, color)
next
x2 = W - 1
for y2 = 0 to H step 6
tft.line(x1, y1, x2, y2, color)
next
tft.fill(0)
x1 = W - 1
y1 = H - 1
y2 = 0
for x2 = 0 to W step 6
tft.line(x1, y1, x2, y2, color)
next
x2 = 0
for y2 = 0 to H step 6
tft.line(x1, y1, x2, y2, color)
next
goto pause
testFastLines:
color1 = tft.rgb(255,0,0)
color2 = tft.rgb(0,0,255)
tft.fill(0)
for y = 0 to H step 5
tft.hline(0, y, W, color1)
next
for x = 0 to W step 5
tft.vline(x, 0, H, color2)
next
goto pause
testRects:
color = tft.rgb(0,255,0)
cx = W / 2
cy = H / 2
tft.fill(0)
n = W
for i = 2 to n step 6
i2 = i / 2
tft.rect(cx - i2, cy - i2, i, i, color)
next
goto pause
testFilledRects:
color1 = tft.rgb(255,255,0)
color2 = tft.rgb(255,0,255)
cx = W / 2 - 1
cy = H / 2 - 1
tft.fill(0)
n = H
for i = n - 1 to 0 step -6
i2 = i / 2
tft.rect.fill(cx - i2, cy - i2, i, i, color1)
tft.rect(cx - i2, cy - i2, i, i, color2)
next
goto pause
testFilledCircles:
color = tft.rgb(255,0,255)
radius = 10
r2 = radius * 2
tft.fill(0)
for x = 0 to W step r2
for y = 0 to H step r2
tft.circle.fill(x, y, radius, color)
next
next
goto pause
testCircles:
color = tft.rgb(255, 255, 255)
radius = 10
r2 = 2*radius
w = H + radius
h = W + radius
for x = 0 to w step r2
for y = 0 to h step r2
tft.circle(x, y, radius, color)
next
next
goto pause
testRoundRects:
cx = W/ 2 - 1
cy = H / 2 - 1
tft.fill(0)
'w = 240
w = H
for i = 0 to w step 6
i2 = i / 2
color = tft.rgb(i, 0, 0)
tft.rect.round(cx - i2, cy - i2, i, i, i / 8, color)
next
goto pause
testTriangles:
cx = W/2 - 1
cy = H/2 - 1
tft.fill(0)
n = W
for i = 0 to n step 5
color = tft.rgb(0, 0, i)
tft.triangle(cx,cy-i,cx-i,cy+i,cx+i,cy+i,color)
next
goto pause
testFilledTriangles:
cx = W/ 2 - 1
cy = H/ 2 - 1
tft.fill(0)
for i = H to 10 step -5
color = tft.rgb(0, i, i)
tft.triangle.fill(cx, cy - i, cx - i, cy + i, cx + i, cy + i, color)
color = tft.rgb(i, i, 0)
tft.triangle(cx, cy - i, cx - i, cy + i, cx + i, cy + i, color)
next
goto pause
pause:
timer 2000,go
wait
go:
return
end