Wire (I2C)
beginTransmission()
Begin a transmission to the I2C slave device with the given address. Subsequently, queue bytes for transmission with the write()
function and transmit them by calling endTransmission()
.
// SYNTAX
Wire.beginTransmission(address);
Parameters: address
: the 7-bit address of the device to transmit to.
Since 1.5.0:
Instead of passing only an address, a WireTransmission
object can be passed to Wire.beginTransmission()
allowing the address and optional parameters such as a timeout to be set. I2C_ADDRESS
is a constant specifying the Wire address (0-0x7e) for your specific I2C device.
// EXAMPLE
Wire.beginTransmission(WireTransmission(I2C_ADDRESS));
// EXAMPLE WITH TIMEOUT
Wire.beginTransmission(WireTransmission(I2C_ADDRESS).timeout(100ms));