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

📄 form1.frm

📁 通过并口控制I2C总线的动态库源码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command2 
      Caption         =   "读"
      Height          =   375
      Left            =   2520
      TabIndex        =   3
      Top             =   1800
      Width           =   1095
   End
   Begin VB.CommandButton Command1 
      Caption         =   "写"
      Height          =   375
      Left            =   600
      TabIndex        =   2
      Top             =   1800
      Width           =   1095
   End
   Begin VB.TextBox Text2 
      Height          =   495
      Left            =   2400
      TabIndex        =   1
      Top             =   600
      Width           =   1215
   End
   Begin VB.TextBox Text1 
      Height          =   495
      Left            =   480
      TabIndex        =   0
      Top             =   600
      Width           =   1215
   End
   Begin VB.Label Label1 
      Caption         =   "读写SVPEX"
      Height          =   255
      Left            =   240
      TabIndex        =   4
      Top             =   120
      Width           =   975
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Const cICAddr = &HA0

Private Sub Command1_Click()
IicWriteByte cICAddr, 0, Val(Form1.Text1.Text)
End Sub

Private Sub Command2_Click()
If GetI2CStatus Then
   MsgBox "read error"
End If
Form1.Text2.Text = IicReadByte(cICAddr, 0)
End Sub

Private Sub Form_Load()
InitLPT Me.hWnd
SDA_In.LPTaddress = 889
SDA_In.NoBit = 7
SDA_In.CPLflag = 0
SDA_Out.LPTaddress = 888
SDA_Out.NoBit = 0
SDA_Out.CPLflag = 1
SCL_In.LPTaddress = 889
SCL_In.NoBit = 6
SCL_In.CPLflag = 1
SCL_Out.LPTaddress = 888
SCL_Out.NoBit = 1
SCL_Out.CPLflag = 1
Set_SDA_In SDA_In.LPTaddress, SDA_In.NoBit, SDA_In.CPLflag
Set_SDA_Out SDA_Out.LPTaddress, SDA_Out.NoBit, SDA_Out.CPLflag
Set_SCL_In SCL_In.LPTaddress, SCL_In.NoBit, SCL_In.CPLflag
Set_SCL_Out SCL_Out.LPTaddress, SCL_Out.NoBit, SCL_Out.CPLflag
End Sub

Private Sub Form_Unload(Cancel As Integer)
EndLPT Me.hWnd
End Sub

⌨️ 快捷键说明

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