请问这个语句如何变成VB6的语句?
1个回答
展开全部
随便写了点 ,行不行你先试试看吧
Public Re_buf(0 To 10) As Byte
Public counter As Byte
Public sign As Byte
Private Sub Command1_Click()
Dim a(0 To 2) As Single
Dim w(0 To 2) As Single
Dim angle(0 To 2) As Single
Dim T As Single
While True
If sign Then
sign = 0
If Re_buf(0) = &H55& Then
Select Case Re_buf(1)
Case &H51&
a(0) = Int(Re_buf(3) * 255 + Re_buf(2)) / 32768# * 16
a(1) = Int(Re_buf(5) * 255 + Re_buf(4)) / 32768# * 16
a(2) = Int(Re_buf(7) * 255 + Re_buf(6)) / 32768# * 16
T = Int(Re_buf(9) * 255 + Re_buf(8)) / 340# + 36.25
Case &H52&
a(0) = Int(Re_buf(3) * 255 + Re_buf(2)) / 32768# * 2000
a(1) = Int(Re_buf(5) * 255 + Re_buf(4)) / 32768# * 2000
a(2) = Int(Re_buf(7) * 255 + Re_buf(6)) / 32768# * 2000
T = Int(Re_buf(9) * 255 + Re_buf(8)) / 340# + 36.25
Case &H53&
a(0) = Int(Re_buf(3) * 255 + Re_buf(2)) / 32768# * 180
a(1) = Int(Re_buf(5) * 255 + Re_buf(4)) / 32768# * 180
a(2) = Int(Re_buf(7) * 255 + Re_buf(6)) / 32768# * 180
T = Int(Re_buf(9) * 255 + Re_buf(8)) / 340# + 36.25
End Select
End If
End If
Wend
End Sub
Public Re_buf(0 To 10) As Byte
Public counter As Byte
Public sign As Byte
Private Sub Command1_Click()
Dim a(0 To 2) As Single
Dim w(0 To 2) As Single
Dim angle(0 To 2) As Single
Dim T As Single
While True
If sign Then
sign = 0
If Re_buf(0) = &H55& Then
Select Case Re_buf(1)
Case &H51&
a(0) = Int(Re_buf(3) * 255 + Re_buf(2)) / 32768# * 16
a(1) = Int(Re_buf(5) * 255 + Re_buf(4)) / 32768# * 16
a(2) = Int(Re_buf(7) * 255 + Re_buf(6)) / 32768# * 16
T = Int(Re_buf(9) * 255 + Re_buf(8)) / 340# + 36.25
Case &H52&
a(0) = Int(Re_buf(3) * 255 + Re_buf(2)) / 32768# * 2000
a(1) = Int(Re_buf(5) * 255 + Re_buf(4)) / 32768# * 2000
a(2) = Int(Re_buf(7) * 255 + Re_buf(6)) / 32768# * 2000
T = Int(Re_buf(9) * 255 + Re_buf(8)) / 340# + 36.25
Case &H53&
a(0) = Int(Re_buf(3) * 255 + Re_buf(2)) / 32768# * 180
a(1) = Int(Re_buf(5) * 255 + Re_buf(4)) / 32768# * 180
a(2) = Int(Re_buf(7) * 255 + Re_buf(6)) / 32768# * 180
T = Int(Re_buf(9) * 255 + Re_buf(8)) / 340# + 36.25
End Select
End If
End If
Wend
End Sub
追问
请问你定义的 counter 是什么意思?如果要把结果显示出来是不是: text1= a() & vbcrlf & T & crlf ?,他是10ms就更新一次,就是实时的显示出来。能留个邮箱吗?我还有一个问题想请教?谢谢。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询