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

Feature request: ADC.read && setTimeout #15

Closed
Bravo13 opened this issue Aug 9, 2015 · 4 comments
Closed

Feature request: ADC.read && setTimeout #15

Bravo13 opened this issue Aug 9, 2015 · 4 comments

Comments

@Bravo13
Copy link

Bravo13 commented Aug 9, 2015

So, is it already realized in smart.js to read data from the adc and what about js functions setTimeout and setInterval?

@mkmik
Copy link
Contributor

mkmik commented Aug 10, 2015

We do have a currently very basic support for setTimeout. It doesn't yet support timer cancellation and on the ESP8266 platform only one timer can be be used at a time (calling setTimeout again will reset the previously set timer).

We'll definitely allow concurrent timers soon, and very likely also implement cancellation support and setInterval as well.

The ADC interface is still TODO.

@erikkaplun
Copy link

+1 any news on this? I actually had a transducer connected to my NodeMCU with the voltage range down to [0.0, 1.0] and all, and then realized I couldn't read it from JavaScript... :(

@mkmik
Copy link
Contributor

mkmik commented Nov 23, 2015

Simple ADC API implemented.

It currently works only on ESP8266, which has only one ADC. Usage:

ADC.read(0)

returns a JS number in the [0.0, 1.0] range.

I tried it only by connecting to ground and VCC. I got .0029296875 and 1.0 respectively
Each device might have to be calibrated. We are just issuing a call the the ESP8266 SDK which offers a very basic interface to the ADC.

@mkmik mkmik closed this as completed Nov 23, 2015
@erikkaplun
Copy link

This is awesome; I think exactly what one would expect. Going to be using it in a few min. Thanks!

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

No branches or pull requests

3 participants