nodemcu / nodemcu-firmware

Lua based interactive firmware for ESP8266, ESP8285 and ESP32
https://nodemcu.readthedocs.io
MIT License
7.64k stars 3.12k forks source link

ads1115 startread callback function is not optional #3517

Open athompson673 opened 2 years ago

athompson673 commented 2 years ago

Setting an interrupt on the alert pin with an appropriate callback function, and calling startread() with no callback results in an error.

> adc:startread()
Lua error:  stdin:1: bad argument #1 to 'startread' (Must be function)

This is contrary to the docs.. Was this a regression, or was this simply never an option?

vsky279 commented 1 year ago

Hi, does the example in https://nodemcu.readthedocs.io/en/dev/modules/ads1115/#ads1115devicestartread work for you?