⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 crc.bas

📁 I2C通讯示意程序通过I2C转换485然后用485通讯
💻 BAS
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -