Return without gosub
Posted: Thu Mar 05, 2020 6:41 am
Hello,
i am new to basic but i am interesting to this interpreter;
i made some test and i write a program but i have a error "return without gosub but i don't find it.
A little help for someone?
SSID = ""
Password = ""
Stringa = ""
Key = ""
IP = ""
SogliaTemperatura = ""
SogliaUmidita = ""
PosizioneServo = ""
Key = read(KeyStore)
if (Key = "127") then
SSID = read(locSSID)
Password = read(locPassword)
wifi.connect(SSID,Password)
else
wprint "<h1>Settings network</h1><hr/><br/>"
wprint "Access point SSID name: "
textbox SSID
wprint "<br/><br/>"
wprint "Access point SSID password: "
passwordbox Password
wprint "<br/><br/>"
button "Confirm", [connect_to_ap]
wprint "<br/><br/><hr/>"
endif
wprint "<h1>Home</h1><hr/><br/>"
wprint "Temperature now: "
wprint "<br/><br/>"
wprint "Humidity now: "
wprint "<br/><br/>"
wprint "Heater: "
wprint "<br/><br/>"
wprint "Humidifier: "
wprint "<br/><br/>"
wprint "Temperature threshold: "
wprint "<br/><br/>"
wprint "Humidity threshold: "
wprint "<br/><br/>"
wprint "Servo position: "
wprint "<br/><br/>
wprint "<br/><br/><hr/>"
wprint "<h1>Settings value</h1><hr/><br/>"
wprint "Temperature threshold: "
textbox SogliaTemperatura
wprint "<br/><br/>"
wprint "Humidity threshold: "
textbox SogliaUmidita
wprint "<br/><br/>"
wprint "Servo position: "
textbox PosizioneServo
wprint "<br/><br/>"
button "Send", [inviovalori]
wprint "<br/><br/><hr/>"
IP = ip()
serialbranch [serialin]
wait
end
[inviovalori]
serialprintln "Ciao"
return
[connect_to_ap]
write(KeyStore,"127")
write(locSSID,SSID)
write(locPassword,Password)
wprint "You must reboot...</h1><hr/><br/>"
do
loop until 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
if (Stringa == "GetTemp") then
serialprintln "GetTemp"
endif
if (Stringa == "GetHumi") then
serialprintln "GetHumi"
endif
if (Stringa == "GetServo") then
serialprintln "GetServo"
endif
if (Stringa == "SetTemp") then
serialprintln "SetTemp"
endif
if (Stringa == "SetHumi") then
serialprintln "SetHumi"
endif
if (Stringa == "SetServo") then
serialprintln "SetServo"
endif
return
i am new to basic but i am interesting to this interpreter;
i made some test and i write a program but i have a error "return without gosub but i don't find it.
A little help for someone?
SSID = ""
Password = ""
Stringa = ""
Key = ""
IP = ""
SogliaTemperatura = ""
SogliaUmidita = ""
PosizioneServo = ""
Key = read(KeyStore)
if (Key = "127") then
SSID = read(locSSID)
Password = read(locPassword)
wifi.connect(SSID,Password)
else
wprint "<h1>Settings network</h1><hr/><br/>"
wprint "Access point SSID name: "
textbox SSID
wprint "<br/><br/>"
wprint "Access point SSID password: "
passwordbox Password
wprint "<br/><br/>"
button "Confirm", [connect_to_ap]
wprint "<br/><br/><hr/>"
endif
wprint "<h1>Home</h1><hr/><br/>"
wprint "Temperature now: "
wprint "<br/><br/>"
wprint "Humidity now: "
wprint "<br/><br/>"
wprint "Heater: "
wprint "<br/><br/>"
wprint "Humidifier: "
wprint "<br/><br/>"
wprint "Temperature threshold: "
wprint "<br/><br/>"
wprint "Humidity threshold: "
wprint "<br/><br/>"
wprint "Servo position: "
wprint "<br/><br/>
wprint "<br/><br/><hr/>"
wprint "<h1>Settings value</h1><hr/><br/>"
wprint "Temperature threshold: "
textbox SogliaTemperatura
wprint "<br/><br/>"
wprint "Humidity threshold: "
textbox SogliaUmidita
wprint "<br/><br/>"
wprint "Servo position: "
textbox PosizioneServo
wprint "<br/><br/>"
button "Send", [inviovalori]
wprint "<br/><br/><hr/>"
IP = ip()
serialbranch [serialin]
wait
end
[inviovalori]
serialprintln "Ciao"
return
[connect_to_ap]
write(KeyStore,"127")
write(locSSID,SSID)
write(locPassword,Password)
wprint "You must reboot...</h1><hr/><br/>"
do
loop until 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
if (Stringa == "GetTemp") then
serialprintln "GetTemp"
endif
if (Stringa == "GetHumi") then
serialprintln "GetHumi"
endif
if (Stringa == "GetServo") then
serialprintln "GetServo"
endif
if (Stringa == "SetTemp") then
serialprintln "SetTemp"
endif
if (Stringa == "SetHumi") then
serialprintln "SetHumi"
endif
if (Stringa == "SetServo") then
serialprintln "SetServo"
endif
return