#include "wire.h" const int SLAVE_ADDRESS = 0x3F; //This address is unique for this device int data[4] = {1, 2, 3, 4}; //This line indicates the data packages that will be sent //to the other device. void setup() { Wire.begin(SLAVE_ADDRESS); //This line starts the wire process. Wire.onRequest(requestEvent); Serial.begin(9600); delay(1000); Serial.println("I2C Esclavo listo"); //This part shows the message } //in the serial monitor. void loop() { data[0]++; //This part of the code writes consecutive numbers and sends them data[1]++; //until you stop it. data[2]++; data[3]++; delay(1000); } void requestEvent() { // This sends data over to the "master" uint8_t byteData[4]; for (int i = 0; i < 4; i++) { byteData[i] = (uint8_t)data[i]; } Wire.write(byteData, 4); }