denkitronik / ADS1118

Arduino Library for Texas Instruments ADS1118 - 16-Bit Analog-to-Digital Converter with internal Reference and Temperature Sensor
MIT License
20 stars 14 forks source link

SAMD Support #5

Open nakanaela opened 4 years ago

nakanaela commented 4 years ago

I managed to get the library working with both the ItsyBitsy M0 and M4 from adafruit with a relatively small code fix. I can submit a pull request(I think) once I get a bit more familiar with GIT, but the only change that needs to be made is to replace

#if defined(__AVR__)

with

#if defined(ARDUINO_ARCH_AVR) || defined(ARDUINO_ARCH_SAMD)

If other boards use the standard SPI configuration as defined for AVRs, then moving to

#if defined(ESP32)
// esp32 specific code here
#elif
// code for everyone else here
#endif

might work better.

alvaro-salazar commented 4 years ago

Hi @nakanaela, I've been busy but I will check your changes as soon as I can. It's much better if you can submit the pull request. Thanks for your contribution.