You are reading a single comment by @Wilberforce and its replies.
Click here to read the full conversation.
-
I got the same error with both versions of Espruino.
My code isvar dht = require("DHT11").connect(D22); function onInit() { setInterval(function () { dht.read(function (a) { console.log(JSON.stringify(a)); }); }, 3000); } onInit();
When a try pin D22 i get the error that i posted in the top post. Guru meditation.. When i try randomly reading pin D17 with the DHT11 module i get the answer
{"err":true,"checksumError":false,"raw":"","temp":-1,"rh":-1}
When i do a analogRead() On pin D22 i get
E (221702) RTC_MODULE: /mnt/c/Users/rhys/esp32/edge/EspruinoBuildTools/esp32/build/esp-idf/components/driver/./rtc_module.c:554 (adc1_config_channel_atten):ADC Channel Err E (221707) RTC_MODULE: /mnt/c/Users/rhys/esp32/edge/EspruinoBuildTools/esp32/build/esp-idf/components/driver/./rtc_module.c:581 (adc1_get_voltage):ADC Channel Err =0.06298828125
Sadly i cannot follow the actual pin to the sensor premounted on the board.. But from a look at other projects they use pin 22.
Sorry - your information is a little vague if you want help with this!
Did you get the crash with 1v95?
Posting your code might help.
Ok. What pin and did yout try? What are you testing?
For the
analogRead
see here:http://www.espruino.com/ESP32#gpio-pins
http://www.espruino.com/ESP32#analog-read-write-example
You should refer to the pins at the D numbers. The pins on the board may be numbered differently. Espruino uses the chip pin numbering for the esp32.
To read ADC0: