59
Example Code
The following examples are written in MS Visual Basic V3 for Windows using the
serial communications control (MSCOMM.VBX). It can be used as a guide in
implementing i2cStick interface programs in other programming languages and
operating environments.
Note:
Sample code is also available online at: www.mcc-us.com
i2cStick Reset
Comm1.Output = Chr$(18)
'Ctrl/R
Comm1.Output = Chr$(18)
'Ctrl/R
Comm1.Output = Chr$(18)
'Ctrl/R
i2cStick Initialization
Comm1.Output = "/f0"
'Set i2cStick XON/XOFF Flow Control
Comm1.Output = Chr$(13)
Comm1.Output = "/i70"
'Set i2cStick’s Own Slave Address
Comm1.Output = Chr$(13)
Comm1.Output = "/d4e"
'Set Destination Slave Address
Comm1.Output = Chr$(13)
Comm1.Output = "/o"
'Open I
2
C Connection
Comm1.Output = Chr$(13)
Master Transmit Message
Comm1.Output = "/T~00~01" 'Send Master Tx Command
Comm1.Output = Chr$(13)
'Terminate Command
Master Receive Message
Comm1.Output = "/R10"
'Send Master Rx Command
Comm1.Output = Chr$(13)
'Terminate Command
Содержание i2cStick
Страница 1: ...User s Guide USB to I2 C Bus Host Adapter with iPort Utility Pack Software www mcc us com...
Страница 9: ......
Страница 10: ...1 Part 1 i2cStick USB to I2 C Bus Host Adapter Part 1 USB to I2 C Bus Host Adapter User s Guide Model MIIC 207...
Страница 20: ...11 Part 2 iPort Utility Pack for Windows Part 2 iPort Utility Pack for Windows...
Страница 21: ...12...
Страница 47: ...38...
Страница 48: ...39 Part 3 i2cStick Programmer s Reference Part 3 Programmer s Reference ASCII Command Interface Definitions...