I2C
A two-wire addressed bus: many sensors share SDA and SCL with pull-up resistors.
Easy
Every device has a 7-bit address. A transaction:
- START — SDA falls while SCL is high.
- Address + R/W bit; the device ACKs (pulls SDA low).
- Data bytes, each acknowledged.
- STOP — SDA rises while SCL is high.
Wire.beginTransmission(0x68); // MPU-6050
Wire.write(0x3B); // register address
Wire.endTransmission(false); // repeated start
Wire.requestFrom(0x68, 6);
Lines are open-drain with pull-ups (4.7 kΩ at 100 kHz is typical; lower values for faster speeds or long buses). Speeds: standard 100 kHz, fast 400 kHz, fast-plus 1 MHz. Run an "I2C scanner" sketch to find device addresses.
Spotted a mistake or want to add detail? Suggest an improvement — Content Contributors' edits are reviewed by editors before they go live.
Discussion (0)
Sign in or join free to ask questions and discuss this topic.