Hello,
I’m trying to get my new QWIIC Quad relay to conenct to the I2C buss of my SAMD21 Pro RF. The issue is unless I have other QWIIC devices connected to the I2C bus the relay does not register. I have proven this by using the scan example in the QWIIC Relay example library and as per the attachments when I have two buttons on the bus i get the addresses of the buttons and the relay. When I remove the buttons and only have the relay and run the scan example again it doesn’t see anything and freezes at the text “Scanning…” on the serial monitor.
Thoughts?
Addresses-
button 0x10
button1 0x11
quadRelay 0x13
The code I used for scanning is below-
#include <SPI.h>
#include <Wire.h> //include Wire.h library
void setup()
{
Serial.begin(115200); // The baudrate of Serial monitor is set in 9600
SerialUSB.begin(115200);
while (!SerialUSB); // Waiting for Serial Monitor
Serial.println("\nI2C Scanner");
Wire.begin(); // Wire communication begin
}
void loop()
{
byte error, address; //variable for error and I2C address
int nDevices;
SerialUSB.println("Scanning...");
nDevices = 0;
for (address = 1; address < 127; address++ )
{
// The i2c_scanner uses the return value of
// the Write.endTransmisstion to see if
// a device did acknowledge to the address.
Wire.beginTransmission(address);
error = Wire.endTransmission();
if (error == 0)
{
SerialUSB.print("I2C device found at address 0x");
if (address < 16)
Serial.print("0");
SerialUSB.print(address, HEX);
SerialUSB.println(" !");
nDevices++;
}
else if (error == 4)
{
SerialUSB.print("Unknown error at address 0x");
if (address < 16)
SerialUSB.print("0");
SerialUSB.println(address, HEX);
}
}
if (nDevices == 0)
SerialUSB.println("No I2C devices found\n");
else
SerialUSB.println("done\n");
delay(5000); // wait 5 seconds for the next I2C scan
}/code]