// Use this project to run precompiled AnnexBasic binary:
// Press "F1", choose "Load HEX File and Start Simulation..."
// Select a precompiled AnnexBasic binary.
// copy this script in the editor page, save and run it
pin.mode 2, output
pin.mode 15, output
pin(2) = 0 : pin(15) = 1
pos = 100: dir = 5
PWM.SETUP 22, 1, pos, 50, 12
tft.init 0
gui.init 20, black
txt = GUI.Textline(10,50,190,50, "Position:", 3)
gui.autorefresh 50
maxscroll.setup 4, 21
maxscroll.print "Annex & WOKWI"
for z = 1 to 1000
pin(2) = 1 - pin(2)
pin(15) = 1 - pin(15)
pause 200
PWM.OUT 1, pos
pos = pos + dir
if (pos < 100) or (pos > 500) then dir = -dir
gui.settext txt,"Position " + str$(pos)
MAXSCROLL.SCROLL 5
next z
esp:VIN
esp:GND.2
esp:D13
esp:D12
esp:D14
esp:D27
esp:D26
esp:D25
esp:D33
esp:D32
esp:D35
esp:D34
esp:VN
esp:VP
esp:EN
esp:3V3
esp:GND.1
esp:D15
esp:D2
esp:D4
esp:RX2
esp:TX2
esp:D5
esp:D18
esp:D19
esp:D21
esp:RX0
esp:TX0
esp:D22
esp:D23
lcd1:VCC
lcd1:GND
lcd1:CS
lcd1:RST
lcd1:D/C
lcd1:MOSI
lcd1:SCK
lcd1:LED
lcd1:MISO
sd1:CD
sd1:DO
sd1:GND
sd1:SCK
sd1:VCC
sd1:DI
sd1:CS
led1:A
led1:C
led2:A
led2:C
servo1:GND
servo1:V+
servo1:PWM
r1:1
r1:2
r2:1
r2:2
matrix1:V+
matrix1:GND
matrix1:DIN
matrix1:CS
matrix1:CLK
matrix1:V+.2
matrix1:GND.2
matrix1:DOUT
matrix1:CS.2
matrix1:CLK.2