Quad Relay Library warnings when compiled for Teensy boards

The Quad Solid State library Example2_Quad_Relay_Basics sketch compiles without errors or warnings using the Arduino UNO in the Arduino IDE. That is because with that board in that IDE the -fpermissive compile flag is set by default.

If you try to compile that board using a Teensy board, the -fpermissive flag is not set and the compiler generates the numerous warnings. Please correct the code so that it works without the -fpermissive flag when using Teensy boards.

In addition, the default I2C address is “RELAY_ADDR 0x6D // Alternate address 0x6C” but when an I2C scan is performed the actual board address (original and unaltered) appears to be 0x08.

Here is the environment being used:

OS: Windows 10

IDE: Arduino version 1.8.12

Boards: Arduino UNO and Teensy 4.0

SparkFun_Qwiic_Relay libraru 1.2.0

These are the warnings

C:\Users\Mike\Documents\Arduino\libraries\SparkFun_Qwiic_Relay_Arduino_Library\src\SparkFun_Qwiic_Relay.cpp: In member function ‘uint8_t Qwiic_Relay::_readCommand(uint8_t)’:

C:\Users\Mike\Documents\Arduino\libraries\SparkFun_Qwiic_Relay_Arduino_Library\src\SparkFun_Qwiic_Relay.cpp:340:36: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:

_i2cPort->requestFrom(_address, 1);

^

In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire/Wire.h:26:0,

from C:\Users\Mike\Documents\Arduino\libraries\SparkFun_Qwiic_Relay_Arduino_Library\src\SparkFun_Qwiic_Relay.h:4,

from C:\Users\Mike\Documents\Arduino\libraries\SparkFun_Qwiic_Relay_Arduino_Library\src\SparkFun_Qwiic_Relay.cpp:12:

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire/WireIMXRT.h:98:10: note: candidate 1: uint8_t TwoWire::requestFrom(int, int)

uint8_t requestFrom(int address, int quantity) {

^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire/WireIMXRT.h:91:10: note: candidate 2: uint8_t TwoWire::requestFrom(uint8_t, uint8_t)

uint8_t requestFrom(uint8_t address, uint8_t quantity) {

^

C:\Users\Mike\Documents\Arduino\libraries\SparkFun_Qwiic_Relay_Arduino_Library\src\SparkFun_Qwiic_Relay.cpp: In member function ‘float Qwiic_Relay::_readVersion(uint8_t)’:

C:\Users\Mike\Documents\Arduino\libraries\SparkFun_Qwiic_Relay_Arduino_Library\src\SparkFun_Qwiic_Relay.cpp:353:36: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:

_i2cPort->requestFrom(_address, 2);

^

In file included from C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire/Wire.h:26:0,

from C:\Users\Mike\Documents\Arduino\libraries\SparkFun_Qwiic_Relay_Arduino_Library\src\SparkFun_Qwiic_Relay.h:4,

from C:\Users\Mike\Documents\Arduino\libraries\SparkFun_Qwiic_Relay_Arduino_Library\src\SparkFun_Qwiic_Relay.cpp:12:

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire/WireIMXRT.h:98:10: note: candidate 1: uint8_t TwoWire::requestFrom(int, int)

uint8_t requestFrom(int address, int quantity) {

^

C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\Wire/WireIMXRT.h:91:10: note: candidate 2: uint8_t TwoWire::requestFrom(uint8_t, uint8_t)

uint8_t requestFrom(uint8_t address, uint8_t quantity) {

^

Opening Teensy Loader…

Sketch uses 17296 bytes (0%) of program storage space. Maximum is 2031616 bytes.

Global variables use 41660 bytes (7%) of dynamic memory, leaving 482628 bytes for local variables. Maximum is 524288 bytes.

I would strongly suggest filing a GitHub issue ticket so our engineers have better visibility of the compilation warnings.

As for the address issue, are you using an the old version or the new version?

New: https://www.sparkfun.com/products/16566

Old: https://www.sparkfun.com/products/retired/15102

I just ordered it. from Sparkfun a week ago it is KIT-16833.

I don’t see any rev marks on the board so I can only assume it is the new version.

If it’s just a warning, but the code still compiles and uploads, then you have nothing to worry about. (The compiler is just complaining that it’s not happy with something)

If you can’t compile under Teensy, the code might not be compatible. If you switch to a Uno or Pro Mini, the code should compile just fine.