Questions with regards to ESP8266 Basic and hardware interfacing and control via Basic commands

Moderator: Mmiscool

User avatar
By stern0m1
#59286 Im having an issue reading the serial port. I am using serialbranch. I tested it with a serial usb adapter connected to a terminal. It only jumps to that branch the first time something is received. After the first time nothing happens. I checked my connections and tried different usb serial adapters.

I am running ESP Basic 3.0.Alpha 64.

Any help will be greatly appreciated.

Thanks


Here's my code:


button "send" , [se]
textbox text

serialbranch [ser]

wait

[se]

SERIALPRINTLN text

wait

[ser]
serialinput s
print s


wait
User avatar
By stern0m1
#59289 I worked around it by using a soft serial and closing it and opening by the serial interrupt branch.

Seems like the serial ports interrupt is not being reset. I dont see any way in basic to do that.

Thanks
User avatar
By Electroguard
#59292 Your serial [branch] subroutine should end with a RETURN rather than WAIT, so that it can go back to look for more incoming serial.

Also, pay attention to where you insert spaces, cos where your button command is expecting a comma delimiter it is actually seeing a space in front of the comma.
User avatar
By stern0m1
#59341 That worked.
I just dont understand when to use wait and when return.
My send branch if I end with return, the debugger says "return without gosub"

thanks