// -*- c++ -*- #ifdef __AVR_ATmega328P__ /* Corresponds to A4/A5 - the hardware I2C pins on Arduinos */ #define SDA_PORT PORTC #define SDA_PIN 4 #define SCL_PORT PORTC #define SCL_PIN 5 #define I2C_FASTMODE 1 #else #define SDA_PORT PORTB #define SDA_PIN 0 #define SCL_PORT PORTB #define SCL_PIN 2 #define I2C_FASTMODE 1 #endif #define I2C_TIMEOUT 100 #define I2C_FASTMODE 1 #include void setup() { Wire.begin(); Serial.begin(9600); } byte inputBuffer[4]; void loop() { if (Serial.available() == 0) { while (Serial.available() == 0) ; Serial.readBytes(inputBuffer, 4); byte p = inputBuffer[0]; if (p == 1) { Wire.beginTransmission(11); Serial.write(Wire.endTransmission()); } } }