Arduino Wire.h: Library //top\\

// Configure sensor (simplified) Wire.beginTransmission(SENSOR_ADDR); Wire.write(0x26); // Control register Wire.write(0xB9); // Active, 128 samples, 2^8mbar max Wire.endTransmission(); delay(100);

Try the built-in I2C scanner (File → Examples → Wire → Scanner), then hook up a cheap OLED or RTC module. You’ll be amazed at what two wires can do. arduino wire.h library

You can also make one Arduino act as a slave. This is useful for multi-processor projects. Master Code (Sends a command): #include <Wire.h> void setup() Wire.begin(); Serial.begin(9600); // Configure sensor (simplified) Wire

if(Wire.available() >= 5) Wire.read(); float pressure = pressure_raw / 64.0 / 100.0; // to hPa // Control register Wire.write(0xB9)

void loop() // Tell sensor to start measurement Wire.beginTransmission(SENSOR_ADDR); Wire.write(0x12); // Pressure data register (MSB) Wire.endTransmission(false); // Repeated start

int temp_raw = ((Wire.read() << 8) delay(1000);