我是基础知识的新手,但我对这个口译员很感兴趣;
我做了一些测试,我写了一个程序,但我有一个错误“没有 gosub 返回,但我没有找到它。
对某人有一点帮助吗?
SSID =“”
密码=“”
Stringa =“”
密钥=“”
IP = \"\"
SogliaTemperatura = \"\"
SogliaUmidita = \"\"
PosizioneServo = \"\"
Key = read(KeyStore)
if (Key = \"127\") then
SSID = read(locSSID)
Password = read(locPassword)
wifi.connect(SSID,Password)
else
wprint \"
设置网络
\"
wprint \"接入点 SSID 密码:\"
passwordbox Password
wprint \"
\"
button \"Confirm\", [connect_to_ap]
wprint \"
\"
endif
wprint \"
首页
\"
wprint \"现在温度:\"
wprint \"
\"
wprint \"现在湿度:\"
wprint \"
\"
wprint \"加热器:“
wprint”
“
wprint”加湿器:“
wprint”
“
wprint”温度阈值:“
wprint”
“
wprint \"湿度阈值:\"
wprint \"
\"
wprint \"伺服位置:\"
wprint \"
wprint \"
\"
wprint \"
设置值
\"
wprint \"温度阈值:\"
textbox SogliaTemperatura
wprint \"
\"
wprint \"湿度阈值:\"
textbox SogliaUmidita
wprint \"
\"
wprint \"伺服位置:\"
textbox PosizioneServo
wprint \"
”
按钮“发送”,[inviovalori]
wprint“
”
IP = ip()
serialbranch [serialin]
等待
结束
[inviovalori]
serialprintln“Ciao”
返回
[ connect_to_ap]
write(KeyStore,\"127\")
write(locSSID,SSID)
write(locPassword,Password)
wprint \"你必须重启...
\"
do
loop un
til 0
return
[serialin]
serialinput Stringa
if (Stringa == \"Reset\") then
SSID = \"\"
Password = \"\"
write(KeyStore,\"\")
write(locSSID,\"\")
write(locPassword,\"\")
wifi.connect(SSID,Password)
endif
if (Stringa == \"GetIP\") then
serialprintln IP
endif
(Stringa == \"GetTemp\") then
serialprintln \"GetTemp\"
endif
(Stringa == \"GetHumi\") then
serialprintln \"GetHumi\"
endif
(Stringa == \"GetServo\" \") then
serialprintln \"GetServo\"
endif
(Stringa == \"SetTemp\") then
serialprintln \"SetTemp\"
endif
if (Stringa == \"SetHumi\") 然后
serialprintln \"SetHumi\"
endif
if (Stringa == \"SetServo\") 然后
serialprintln \"SetServo\"
endif
返回