发表于:2004-04-14 10:17:00
楼主
下面是一段数据采集的函数,我看的不太明白
是一个12位AD转换
out_byte输出一个字节,最后得出的da是采集的结果
Function ad5101(channel As Integer) As Integer
Dim h, m, l, da As Integer
out_byte &H378, channel
delay (100)
out_byte &H378, &H20 + channel
delay (500)
out_byte &H378, &H40
delay (50)
h = Int(in_byte(&H379) / 16)
out_byte &H378, &H60
delay (50)
m = Int(in_byte(&H379) / 16)
out_byte &H378, &H80
delay (50)
l = Int(in_byte(&H379) / 16)
da = h * 256 + m * 16 + l
ad5101 = da
End Function
那位高手给我说一下他的具体算法