Updating Master.ino file

This commit is contained in:
Fatima Idrees 2025-05-19 14:36:24 +03:00
parent 41ee3def63
commit f13d62d44e

View File

@ -1,5 +1,4 @@
#include <Wire.h>
#include "I2CRelay.h"
#include <I2CRelay.h>
I2CRelay relay(8, 3); // Use your SDA/SCL pins
@ -56,13 +55,11 @@ void setup() {
delay(3500);
// 10. Change slave address from 0x08 to 0x09
Serial.println("=== Change Address 0x08 -> 0x09 ===");
relay.setSlaveAddress(0x08, 0x08);
addr = 0x08; // Use new address for further commands
relay.setSlaveAddress(0x08, 0x10);
addr = 0x10; // Use new address for further commands
delay(1500);
// 11. Confirm new address by requesting info
Serial.println("=== Request Info from 0x09 ===");
info = relay.requestSlaveInfo(addr);
Serial.print("Info: ");
Serial.println(info);