#include #define LED_TX_PIN 0 // Pin del LED conectado al TX #define LED_RX_PIN 1 // Pin del LED conectado al RX void setup() { pinMode(LED_TX_PIN, OUTPUT); pinMode(LED_RX_PIN, OUTPUT); Wire.begin(8); Wire.onReceive(receiveEvent); } void loop() { } void receiveEvent(int howMany) { while (Wire.available()) { char c = Wire.read(); switch (c) { case 'T': digitalWrite(LED_TX_PIN, !digitalRead(LED_TX_PIN)); break; case 'R': digitalWrite(LED_RX_PIN, !digitalRead(LED_RX_PIN)); break; } } }