adafruit / Adafruit_ADS1X15

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

templatize m_conversionDelay and m_bitShift #17

Closed Palatis closed 3 years ago

Palatis commented 8 years ago

save a bit code space and variable usage.

result for the "singleended" example:

before: Sketch uses 4,946 bytes (15%) of program storage space. Maximum is 32,256 bytes. Global variables use 553 bytes (27%) of dynamic memory, leaving 1,495 bytes for local variables. Maximum is 2,048 bytes.

after: Sketch uses 4,936 bytes (15%) of program storage space. Maximum is 32,256 bytes. Global variables use 551 bytes (26%) of dynamic memory, leaving 1,497 bytes for local variables. Maximum is 2,048 bytes.

soligen2010 commented 8 years ago

you might want to check out my fork - I got rid of conversion delay entirely and added a lot of other nice stuff. using hard coded conversion delays turns out to be unreliable because some chips need more time than the spec would indicate.

Palatis commented 8 years ago

yeah ladyada might be busy doing something else.

caternuson commented 3 years ago

The conversion delay issue has been taken care of with #59.