Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim mBuffer(mCH341_PACKET_LENGTH) As Byte Dim mLength As UInteger Dim mInLen As UInteger mBuffer(0) = mCH341A_CMD_I2C_STREAM ' 命令碼 mBuffer(1) = mCH341A_CMD_I2C_STM_STA mBuffer(2) = mCH341A_CMD_I2C_STM_OUT ' 輸出數(shù)據(jù),位5-位0為長度,0長度則只發(fā)送一個字節(jié)并返回應(yīng)答 mBuffer(3) = &HA0 ' 數(shù)據(jù)
mBuffer(4) = mCH341A_CMD_I2C_STM_OUT ' 輸出數(shù)據(jù),位5-位0為長度,0長度則只發(fā)送一個字節(jié)并返回應(yīng)答 mBuffer(5) = &H0 ' 數(shù)據(jù)
mBuffer(6) = mCH341A_CMD_I2C_STM_OUT ' 輸出數(shù)據(jù),位5-位0為長度,0長度則只發(fā)送一個字節(jié)并返回應(yīng)答 mBuffer(7) = &H55 ' 數(shù)據(jù)
mBuffer(8) = mCH341A_CMD_I2C_STM_STO mBuffer(9) = mCH341A_CMD_I2C_STM_END ' 當(dāng)前包提前結(jié)束 mLength = 10 mInLen = 0
If (CH341.CH341WriteRead(0, mLength, mBuffer(9), mCH341A_CMD_I2C_STM_MAX, 1, mInLen, mBuffer(9)) = True) Then ' 執(zhí)行數(shù)據(jù)流命令,先輸出再輸入 MsgBox("寫數(shù)據(jù)成功!", vbExclamation, "CH341") End If End Sub 這個VB.NET程序運行時就卡死,哪位仁兄幫忙分析一下!謝謝