crc.bas
来自「I2C通讯示意程序通过I2C转换485然后用485通讯」· BAS 代码 · 共 38 行
BAS
38 行
Attribute VB_Name = "MODECRC"
Option Explicit
Public bytReceiveByte() As Byte
Public intReceiveLen As Integer
Public bytSendByte() As Byte
Public intinputlen As Integer
Public bytInput() As Byte
Global Const CRC_REGISTER = "1111111111111111"
'dalay
Public Declare Function GetTickCount Lib "kernel32" () As Long
'**********************************
Public Function clock_ms() As Long
Static last_clock As Long ', reval As Long
last_clock = GetTickCount
clock_ms = last_clock
End Function
Public Sub delay_ms(I As Integer)
Dim j As Long
j = clock_ms()
Do While Abs(j - clock_ms) < I
'DoEvents
Loop
End Sub
Public Function CRC_CHECK(CHECK_CODE As String, CRC_REGISTER As String) As String
Dim CRCcount As String
Dim result As String
Dim shift_count As Integer
Dim I As Integer
Dim LSB As String
result = ""
'矪瞶材
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?