[SOLVED] ADS1x15 module is not really compatible with ADS1115 #1082
Replies: 4 comments
-
Posted at 2022-08-09 by @gfwilliams Thanks for figuring that out! Is everything else basically the same though? So as far as I can see the ADS1015 would run at 1600 samples/second by default while the ADS1115 is only 128 (which was the default in both cases) - but everything should still work ok? It's frustrating not having an I2C WHOAMI register! I thought pretty much every device had them now. I'd have said duplicating everything just for that might be overkill - what about extending the
So then anyone using this already would have it work fine, but it could easily support the ADS1115 |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-08-23 by @yerpj Thank you @gordon. I tried to implement this feature according to your recommendation and made a pull request here: espruino/EspruinoDocs#665 However, when testing, I got this error
It is most probably a very noob, basic javascript error. Could you help me figure out what's going wrong with the way I made the change? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-08-24 by @gfwilliams I think it's that you're using 'default arguments' which is a newish JS feature that Espruino doesn't support yet. I've just merged your PR and hopefully tweaked it though |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-08-24 by @yerpj Thank you very much, I must say that I didn't look so deep into other modules to check how optional parameters were handled. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2022-08-05 by @yerpj
I just made a few experiments with an Adafruit 1115 breakout board along with the module EspruinoDocs/devices/ADS1X15.js. I compared the datasheet of ADS1115 and ADS1015 and it appears that the datarate config (DR[2:0]) is not the same. Thus, the ADS1X15.js is only valid for ADS1015. As long as the ADC type cannot be discovered at runtime, it may be better to make 2 modules instead of one, but it means renaming the js file. I don't know @gordon what would be the best way to go because renaming the current js module will break compatibility for those who currently use it.
Any hint?
Kind regards,
Beta Was this translation helpful? Give feedback.
All reactions