adafruit / Adafruit_ADS1X15

Driver for TI's ADS1015: 12-bit Differential or Single-Ended ADC with PGA and Comparator
Other
289 stars 301 forks source link

should be uint16_t because readADC_SingleEnded() returns uint16_t not int16_t #54

Closed Alvedro closed 3 years ago

Alvedro commented 4 years ago

https://github.com/adafruit/Adafruit_ADS1X15/blob/6560438adca9f0a7d9c432e3cca35f0f18778a94/examples/singleended/singleended.ino#L33

caternuson commented 3 years ago

It's generally OK since the register value is signed. What might be even better is to change the return to int16_t, even though no negative values will be generated.

Are you finding the implicit cast ends up causing issues? Closing for now and can reopen if needed.