!!top!! Download Wire.h Library For Arduino Page
: Begins a transmission to a slave device with a specific address. Wire.write() : Queues data for transmission. Wire.endTransmission() : Ends the transmission and sends the data. Arduino IDE and Wire.h?
In this example, we're using the Wire library to communicate with an I2C device with address 0x12 . We're writing data to the device, then reading data back from the device and printing it to the serial console. download wire.h library for arduino
void setup() Wire.begin(); // Join I2C bus as master Serial.begin(9600); : Begins a transmission to a slave device
: Begins a transmission to a slave device with a specific address. Wire.write() : Queues data for transmission. Wire.endTransmission() : Ends the transmission and sends the data. Arduino IDE and Wire.h?
In this example, we're using the Wire library to communicate with an I2C device with address 0x12 . We're writing data to the device, then reading data back from the device and printing it to the serial console.
void setup() Wire.begin(); // Join I2C bus as master Serial.begin(9600);