Arduino Wire.h Library May 2026

#include <Wire.h> void receiveEvent(int bytes) while(Wire.available()) char c = Wire.read(); Serial.print(c);

Serial.println();

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

void setup() Serial.begin(9600); Wire.begin(); // Join I2C bus as master #include &lt;Wire