Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ads1115 module #1942

Merged
merged 3 commits into from
May 7, 2017
Merged

add ads1115 module #1942

merged 3 commits into from
May 7, 2017

Conversation

fetchbot
Copy link
Contributor

  • This PR is for the dev branch rather than for master.
  • This PR is compliant with the other contributing guidelines as well (if not, please describe why).
  • I have thoroughly tested my contribution.
  • The code changes are reflected in the documentation at docs/en/*.

Adds a module for the ADS1115 16-Bit analog-to-digital converter.


switch (ads1115_samples) {
case (ADS1115_DR_8SPS):
os_delay_us(128000);
Copy link
Contributor

@dnc40085 dnc40085 Apr 26, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this should use a timer instead of a delay. A current issue (#1892) is suggesting that we remove all instances of os_delay_us from the code base.

Edit: I shouldn't comment when I'm tired.
From the Extension Developer FAQ:

The Espressif guideline is that no individual task should run for more than 15 mSec, before returning control to the SDK.

Considering this information, it might be better to have the ADC read be asynchronous, so the processor can do other things while waiting for the ADC to return the value.

* `ads1115.DIFF_1_3` channel 1 to 3
* `ads1115.DIFF_2_3` channel 2 to 3
- `MODE` Device operating mode
* `ads1115.SINGLE_SHOT` singel-shot mode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo. Should be Single-shot.

Copy link
Member

@devsaurus devsaurus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @zelll!

@devsaurus devsaurus added this to the 2.0.0-follow-up milestone May 7, 2017
@devsaurus devsaurus merged commit faefc09 into nodemcu:dev May 7, 2017
@fetchbot fetchbot deleted the dev-ads1115 branch May 7, 2017 17:55
eiselekd pushed a commit to eiselekd/nodemcu-firmware that referenced this pull request Jan 7, 2018
* add ads1115 module

* replace os_delay with os_timer

* typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants