#include //#define DEBUG static volatile byte rbuff[256]; static volatile uint8_t po; void setup() { Wire.begin(8);// Slave ID #8 Wire.onRequest(requestEvent); Wire.onReceive(receiveEvent); #ifdef DEBUG Serial.begin(19200); #endif } void loop() { } void receiveEvent(int num) { byte rd; po = 0; while(Wire.available()) { rd = Wire.read(); #ifdef DEBUG Serial.print((char)rd); #endif rbuff[po] = rd; if(++po > 254) po = 0; } #ifdef DEBUG Serial.println(); #endif } void requestEvent() { for(int i=0; i