B4R Question Send ASCII chrs

Status
Not open for further replies.

Mostez

Well-Known Member
Licensed User
Longtime User
Hello,
how can I send ascii (2) and (4) characters to async stream, not "2" and "4" (ascii 50 and 52)

Thanks
 

MichalK73

Well-Known Member
Licensed User
Longtime User
How to send the end of the line?
B4X:
    If Buffer ="setup" Then
        ser.Write("__________")
        ser.Write("pu - pokaz ustawienia")
        ser.Write("cxx - czas czujki")
    End If

I have result in serial terminal
"__________pu - pokaz ustawieniacxx - czas czujki"
I wish that it was so
__________
pu - pokaz ustawienia
cxx - czas czujki

How to do it?
 
Upvote 0

MichalK73

Well-Known Member
Licensed User
Longtime User
Upvote 0

inakigarm

Well-Known Member
Licensed User
Longtime User
example ??
Well, I've attached the code before
B4X:
astream.Write(Array As Byte(10))
--> ascii 10 = LF (LineFeed)

Not Tested..
B4X:
If Buffer ="setup" Then
        ser.Write("__________")
        ser.Write("pu - pokaz ustawienia")
        ser.Write(Array As Byte(10))
        ser.Write("cxx - czas czujki")
  End If

upload_2016-11-17_19-34-29.png
 
Upvote 0

sasetcolombia

Member
Licensed User
Longtime User
how could i define this string in a variable(I need to include the character chr (34))
AT+SAPBR=3,1,"Contype","GPRS"

this definition marks an error in "\"
Private SAPBR As String= "AT+SAPBR=3,1,\"Contype\",\"GPRS\""
 
Upvote 0

Michael1968

Active Member
Licensed User
Longtime User
how could i define this string in a variable(I need to include the character chr (34))
AT+SAPBR=3,1,"Contype","GPRS"

this definition marks an error in "\"
Private SAPBR As String= "AT+SAPBR=3,1,\"Contype\",\"GPRS\""

Hi sasetcolombia,
this is an old thread
pls start an new thread

this can help you:
https://www.b4x.com/android/forum/t...k-in-astream-write-solved.103811/#post-650840
https://www.b4x.com/android/forum/threads/b4x-smart-string-literal.50135/page-3#post-691084
https://www.b4x.com/android/forum/t...arks-in-a-string-variable.102045/#post-640514

best regards
Michael
 
Upvote 0
Status
Not open for further replies.
Top