Table 5.19: I2COUT Quick Facts.
5: BASIC Stamp Command Reference – I2COUT
I2COUT
BS1
2
I2COUT Pin, SlaveID, Address {\LowAddress}, [OutputData]
p
Function
Send data to a device using the I
• Pin is a variable/constant/expression (0 or 8) that specifies which
I/O pins to use. I
The Pin argument serves a double purpose; specifying the first pin
(for connection to the chip's SDA pin) and, indirectly, the other
required pin (for connection to the chip's SCL pin). See explanation
below. Both I/O pins will be toggled between output and input
mode during the I2COUT command and both will be set to input
mode by the end of the I2COUT command.
• SlaveID is a variable/constant/expression (0 – 255) indicating the
unique ID of the I
• Address is a variable/constant/expression (0 – 255) indicating the
desired address within the I
argument may be used with the optional LowAddress argument to
indicate a word-sized address value.
• LowAddress is a variable/constant/expression (0 – 255) indicating
the low-byte of the word-sized address within the I
data from. This argument must be used along with the Address
argument.
• OutputData
formatters that tells I2COUT how to format outgoing data. I2COUT
can transmit individual or repeating bytes, convert values into
decimal, hexadecimal or binary text representations, or transmit
strings of bytes from variable arrays. These actions can be combined
in any order in the OutputData list.
Quick Facts
Values for Pin
When Pin is 0:
I/O pin
0: Serial Data (SDA) pin
arrangement
1: Serial Clock (SCL) pin
Transmission
Approximately 81 kbits/sec (not including overhead).
Rate
Both the SDA and SCL pins must have 4.7 KΩ pull-up resisters.
Special notes
The I2COUT command does not allow for multiple masters.
The BASIC Stamp cannot operate as an I
BASIC Stamp Programming Manual 2.0c • www.parallaxinc.com • Page 143
BS2
BS2e BS2sx
2
C protocol.
2
C devices require two I/O pins to communicate.
2
C chip.
2
C chip to send data to. The Address
is a list of variables, constants, expressions and
BS2p
2
C chip to receive
BS2p
0 or 8
When Pin is 8:
8: Serial Data (SDA) pin
9: Serial Clock (SCL) pin
2
C slave device.
Need help?
Do you have a question about the BASIC Stamp 2e and is the answer not in the manual?