variable = I2CWrite(data)
|variable||Acknowledge (0=Acknowledgment, 1=No Acknowledgment)|
|data||data to send (Byte value : 0 to 255)|
Sends one byte of data through I2C. This command creates an ACK pulse and returns 0 if there is an acknowledgment and 1 if there isn’t. No acknowledgment indicates that there was a communication error (possibly due to incorrect wiring). The following is an example illustrating how this can be used to trigger an error processing function:
If I2CWrite(DATA)=1 Then GoTo ERR_PROC
If you don’t need to check for an ACK, you can just use any variable to receive the ACK status as shown below:
A = I2CWrite(DATA)
One byte of data transfer takes approximately 60 microseconds. Please refer to Chapter 8 “About I2C…” for a detailed description of I2C communications.