vb和单片机之间的16进制转换问题

ppcust ppcust 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
各位大虾:
从单片机传送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
多谢
...全文

相关推荐

评论 3
收藏 已收藏
分享
返回顶部
ppcust
单片机/工控 27,522 成员 28,796 内容