Report Bugs Here

Moderator: Mmiscool

User avatar
By rey
#53261 print chr(0) is not working in ESP Basic 3.0.Alpha 41

' NOT WORKING
for i=0 to 255
print i & " - " & chr(i)
next i
end

and

'WORKING
for i=1 to 255
print i & " - " & chr(i)
next i
end

I think that I have the similar problem with SERIAL2INPUT command.
User avatar
By Mmiscool
#53445 The problem with chr(0) is that it terminates a string c/c++.

If you notice it prints out on the serial port but the web output is cut off at this point.

I suggest never using print or wprint to output this character.

You may still use serialprint to send this character out the serial port.
User avatar
By rey
#53530 Thank you very much for your response and excellent work.

I have a problem. I work with modules that use hex commands and need to send and receive chr (0) by the serial port.
Sending chr (0) is OK, but receiving the hex command truncates the message when chr (0) is received.