字符串表达的ascii怎么才能转化成Byte类型?
定义了Dim buf As String
buf="d64f4b2a4638bb",里面为16进制表示的ascii码,我想将它从串口用二进制方式发出去,请问我怎么做才能先将它转换成Byte类型?
[解决办法]
buf = "d64f4b2a4638bb"
dim b() as byte(0 to len(buf) / 2 - 1)
for i = 0 to len(buf) / 2 - 1
b(i) = "&H" & mid(buf, i * 2 + 1, 2)
next