1.這是送一個指令的方法 

SerialPort2.Write(CMD.Text & Chr(&HD))

說明:0x0D為console的斷句碼

 

2.順帶一提,如果VB送byte 的UART的寫法

Dim VV(5) As Byte
VV(0) = &H40
VV(1) = &H30
VV(2) = &H0
VV(3) = &H0
VV(4) = &H40 Xor &H30 Xor &H0 Xor &H0
SerialPort2.Write(VV, 0, 5)

arrow
arrow
    文章標籤
    UART console
    全站熱搜

    JL8051 發表在 痞客邦 留言(0) 人氣()