Arduino R4 with PRDC_AD7193 update

When using the demo code for the library, you need to make a change for it to work with the Arduino R4. The header file (PRDC_7193.h) will throw errors on compile because PIN_SPI_SS is defined for the R3, but not for the R4. The R4 uses PIN_SPI_CS You will get an error of:

error: 'PIN_SPI_SS' was not declared in this scope

To solve this, you replace this line of code:

#define AD7193_DEFAULT_CS PIN_SPI_SS

with these lines which will let it compile for either the R4 or the R3 Arduinos:


#if defined(PIN_SPI_SS)
#define AD7193_DEFAULT_CS PIN_SPI_SS
#else
#define AD7193_DEFAULT_CS PIN_SPI_CS
#endif

The person who solved this for me was van_der_Decken on this forum. I am only posting this to document the problem/solution. I don't need a reply.

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