module1.bas

来自「一个测试转角的程序」· BAS 代码 · 共 68 行

BAS
68
字号
Attribute VB_Name = "Module1"
Function startjiao() As Single
Dim s As Single
s = 0
s1 = 0
s2 = 0
hDevice = USB2010_CreateDevice(0)
 If hDevice = INVALID_HANDLE_VALUE Then
   MsgBox "创建设备对象失败"
   Exit Sub
 End If
dAvg = 360 / 8192
 bStatus = USB2010_GetDeviceDI(hDevice, Para_DI)
   If bStatus = False Then
    Exit Sub
    End If
  If (Para_DI.DI0) = 1 Then
    s = s + 1
  End If
  If (Para_DI.DI1) = 1 Then
    s = s + 2
  End If
  If (Para_DI.DI2) = 1 Then
   s = s + 4
  End If
  If (Para_DI.DI3) = 1 Then
   s = s + 8
  End If
  If (Para_DI.DI4) = 1 Then
   s = s + 16
  End If
  If (Para_DI.DI5) = 1 Then
   s = s + 32
  End If
  If (Para_DI.DI6) = 1 Then
   s = s + 64
  End If
  If (Para_DI.DI7) = 1 Then
    s = s + 128
  End If
  If (Para_DI.DI8) = 1 Then
   s = s + 256
  End If
  If (Para_DI.DI9) = 1 Then
   s = s + 512
  End If
  If (Para_DI.DI10) = 1 Then
   s = s + 1024
  End If
  If (Para_DI.DI11) = 1 Then
   s = s + 2048
  End If
  If (Para_DI.DI12) = 1 Then
    s = s + 4096
  End If
 s1 = s
 Text1.Text = Format(0, "###0.000")

USB2010_ReleaseDevice hDevice




End Function
Function endjiao() As Single

End Function

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?