logo elektroda
logo elektroda
X
logo elektroda

ESP8266 NodeMCU v3 and DS18B20: Sensors are not detected - why?

hipekk 810 1
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 21074315
    hipekk
    Level 19  
    Hi.

    I have an ESP8266 WiFi Module + NodeMCU v3 to which I have connected two DS18B20 sensors under pin D7.

    For some reason the sensors are not detected.

    main.cpp
    Code: C / C++
    Log in, to see the code


    TemperatureSensorController.cpp
    Code: C / C++
    Log in, to see the code


    Result of program:
    Screenshot showing the program output with the result Device count: 0.




    Physically the connections are ok - running the code where everything is in main.cpp reads are executed correctly.

    main.cpp
    Code: C / C++
    Log in, to see the code



    Output displaying temperatures from two sensors.



    Thanks in advance for your help.
  • ADVERTISEMENT
  • #2 21075389
    p.kaczmarek2
    Moderator Smart Home
    I have a definite suspicion of what might be going on here. I've flipped the code into Visual and done a little example:
    Code: C / C++
    Log in, to see the code

    Result:
    Screenshot of program output showing pointer addresses and variable values.
    You may now wonder why these pointers are pointing to different objects of the OneWire class....
    Helpful post? Buy me a coffee.
ADVERTISEMENT