You are reading a single comment by @Wilberforce and its replies. Click here to read the full conversation.
  • Sorry - your information is a little vague if you want help with this!

    I tried with both 1v95 and 1v94 and none worked.

    Did you get the crash with 1v95?

    Posting your code might help.

    I tried just choosing a different pin aswell, and then i got

    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-rea­d-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:

    >analogRead(D35);
    =0
    
  • I got the same error with both versions of Espruino.
    My code is

        var 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/EspruinoBui­ldTools/esp32/build/esp-idf/components/d­river/./rtc_module.c:554 (adc1_config_channel_atten):ADC Channel Err
    E (221707) RTC_MODULE: /mnt/c/Users/rhys/esp32/edge/EspruinoBui­ldTools/esp32/build/esp-idf/components/d­river/./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.

About

Avatar for Wilberforce @Wilberforce started