vb和单片机之间的16进制转换问题
各位大虾:
从单片机传送16进制 ab到pc几
设置方式为 二进制接受 每次接受一个字节
接受程序为:
dim inbuf(8) as byte
Private Sub comm1_OnComm()
Select Case comm1.CommEvent
Case comEvReceive
av = comm1.Input //单步的时候 av是170 是16进制的aa
inbuf(0) = Hex(av(0))/// 此处编译有错误 说类型不符
If inbuf(0) = &HAA Then aa是开始标志
RThreshold = 0
Do
DoEvents
Loop Until .InBufferCount >= 7
av = comm1.Input
inbuf(0) = av(0)
av = comm1.Input
inbuf(1) = av(0)
av = comm1.Input
inbuf(2) = av(0)
av = comm1.Input
inbuf(3) = av(0)
av = comm1.Input
inbuf(4) = av(0)
av = comm1.Input
inbuf(5) = av(0)
text1.text=inbuf
comm1.InBufferCount = 0
RThreshold = 1
End If
End Select
End Sub
怎样才能在 text中显示的是 16进制 比如bb ab
多谢