logo elektroda
logo elektroda
X
logo elektroda

[Solved] Simplifying ESP8266 Code to Display Only Temperature from DS18B20 Sensor

slowik359 528 4
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 20724796
    slowik359
    Level 4  
    Code: C / C++
    Log in, to see the code
    .
  • ADVERTISEMENT
  • Helpful post
    #2 20724806
    ElektrodaBot
    AI OpenAI ChatGPT4
    slowik359 wrote:
    (...)
    Blynk.virtualWrite(VPIN_coolerbtn, coolerState);
    }
    }
    if (modeState == 0)

    {
    display.setTextSize(1); // Draw 2X-scale text
    display.setTextColor(SSD1306_WHITE);
    display.setCursor(32, 45);
    display.print("Manual Mode");
    display.display();
    }


    delay(3000);
    }
    Hello,

    It looks like the code you provided is incomplete. However, I can give you a basic concept of how the code can be updated to display the temperature measurement from the DS18B20 sensor on the OLED display and send the data to the Blynk application.

    I assume you are using libraries that support the ESP8266 module, DS18B20 sensor, OLED display and Blynk.

    Below is sample code that shows how to do what you are describing:


    Code: text
    Log in, to see the code


    Assuming the DS18B20 sensor is connected to pin D2 on the ESP8266 board, this code will read the temperature from the DS18B20 sensor, display it on the OLED display, and then send it to the Blynk application.

    Substitute "YourAuthToken", "YourNetworkName" and "YourPassword" with your Blynk token, Wi-Fi network name and password.

    This code is fairly simple and does not include error handling, so you will probably want to extend it to better suit your needs.

    Please note that you will need to install the required libraries in the Arduino IDE environment. These libraries are: Adafruit_GFX, Adafruit_SSD1306, OneWire, DallasTemperature, ESP8266WiFi, BlynkSimpleEsp8266.

    Hope this helps! If you have any questions, feel free to ask.
    .
    You can call me in any topic by writing @ElektrodaBot. Disclaimer: Some answers provided by the ElektrodaBot may be inaccurate. Elektroda not responsible for accuracy, reliability or completeness of the information presented. All ElektrodaBot responses should be verified by the user. OpenAI can monitor and save information entered after calling ElektrodaBot.
  • ADVERTISEMENT
  • #3 20724883
    slowik359
    Level 4  
    Code: C / C++
    Log in, to see the code


    Added after 3 [minutes]:

    The whole code. I will check tomorrow
  • ADVERTISEMENT
  • #4 20725767
    slowik359
    Level 4  
    I have uploaded what they specified
  • #5 20729002
    slowik359
    Level 4  
    as they wrote
ADVERTISEMENT