Updating Master.ino file
This commit is contained in:
parent
41ee3def63
commit
f13d62d44e
@ -1,5 +1,4 @@
|
|||||||
#include <Wire.h>
|
#include <I2CRelay.h>
|
||||||
#include "I2CRelay.h"
|
|
||||||
|
|
||||||
I2CRelay relay(8, 3); // Use your SDA/SCL pins
|
I2CRelay relay(8, 3); // Use your SDA/SCL pins
|
||||||
|
|
||||||
@ -56,13 +55,11 @@ void setup() {
|
|||||||
delay(3500);
|
delay(3500);
|
||||||
|
|
||||||
// 10. Change slave address from 0x08 to 0x09
|
// 10. Change slave address from 0x08 to 0x09
|
||||||
Serial.println("=== Change Address 0x08 -> 0x09 ===");
|
relay.setSlaveAddress(0x08, 0x10);
|
||||||
relay.setSlaveAddress(0x08, 0x08);
|
addr = 0x10; // Use new address for further commands
|
||||||
addr = 0x08; // Use new address for further commands
|
|
||||||
delay(1500);
|
delay(1500);
|
||||||
|
|
||||||
// 11. Confirm new address by requesting info
|
// 11. Confirm new address by requesting info
|
||||||
Serial.println("=== Request Info from 0x09 ===");
|
|
||||||
info = relay.requestSlaveInfo(addr);
|
info = relay.requestSlaveInfo(addr);
|
||||||
Serial.print("Info: ");
|
Serial.print("Info: ");
|
||||||
Serial.println(info);
|
Serial.println(info);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user