Pcf8575 use with nano blu

Im using the library written for a Uno so I get and error when I try to use it with the Nano blu 33 sense.

error

Arduino: 1.8.19 (Windows Store 1.8.57.0) (Windows 10), Board: "Arduino Nano 33 BLE"

In file included from Arduino\libraries\PCF8575\examples\blinkOnPin0\blinkOnPin0.ino:9:0:

Arduino\libraries\PCF8575/PCF8575.h:189:18: error: 'SDA' was not declared in this scope

uint8_t _sda = SDA;

              ^~~

\Arduino\libraries\PCF8575/PCF8575.h:190:18: error: 'SCL' was not declared in this scope

uint8_t _scl = SCL;

              ^~~

\Arduino\libraries\PCF8575/PCF8575.h:190:18: note: suggested alternative: 'SCK'

uint8_t _scl = SCL;

              ^~~

              SCK

exit status 1

Error compiling for board Arduino Nano 33 BLE.

I do not know your software you may have to define those pins. As opposed to other Arduino Nano boards, pins A4 and A5 have an internal pull up and default to be used
as an I2C Bus so usage as analog inputs is not recommended. There is new documentation out, use this link: "https://docs.arduino.cc/resources/datasheets/ABX00030-datasheet.pdf"

There seems to be an extra underscore, which is joining the data type to the variable name.
Try:

uint8_t  sda = SDA;

Etc.
And as stated by @gilshultz, please be sure that you are using the correct pins.

Perhaps you can find another library that works. There are at least four PCF8575 libraries available through Tools -> Manage Libraries...

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.