Published On Feb 24, 2023
Adding a temperature sensor reading onto a web page, two methods.
► PCBWay $5 for 10 pieces https://www.pcbway.com
Don't start with this video!
PART 1 shows how to create a landing page on the ESP32 along with OTA (Over The Air, wireless) updates and can be found here • #258 ESP32 Web Pages AND OTA updates ... with the code you need too! 😉
And whilst we're on the subject, Part 3 will be available soon which brings it all together and shows the full (and final, improved) ESP32 webpage. But that's for another time. Keep tuned (and subscribed).
All the code and more in my GitHub: https://bit.ly/GitHub_for_Part2
Still here? OK, let's get some values on screen, whether that be an integer value or a string, both of which I use in my projects. There are, of course, many routes to Rome and I show two of them here. Quick and dirty? Or slick and maintainable? Your choice!
We'll get a value onto the screen (from a pseudo-variable in our ESP32 code) and discuss two ways on how to do that. Finally we'll consider whether what we're doing, that is putting the HTML code into our C++ code is the best way of doing this - or is there another way we could explore (in part 3 perhaps)? Oops, spoiler alert! Too late!
Software
► Rob Tillaart's simple DS18b20 library (for a single DS18b20 per μController pin)
https://github.com/RobTillaart/DS18B2...
► Pi Hit Waterproof DS18b20
https://thepihut.com/products/waterpr...
► 5 x DS18b20 eBay Seller umtmedia
https://www.ebay.co.uk/itm/265498296922
► Pointers in C++
https://www.cpp.edu/~elab/ECE114/Poin...
► StackOverflow clarification (by others) into pointers & references used in my code
https://bit.ly/pointerToString
HTML
► W3Schools HTML tutorials
https://www.w3schools.com/tags/tag_bu...
► Location of Arduino Partition descriptions (.csv files)
C:\Users[Your Name]\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.5\tools\partitions
NOTE: the ESP32 version (here: 2.0.5) name might be different. Just choose the highest number you have.
Other Stuff
► List of all my videos (Special thanks to Michael Kurt Vogel for compiling this)
http://bit.ly/YouTubeVideoList-RalphB...
► If you like this video please give it a thumbs up, share it and if you're not already subscribed please consider doing so and joining me on my Arduinite (and other μControllers) journey
My channel, GitHub and blog are here:
------------------------------------------------------------------
• / ralphbacon
• https://ralphbacon.blog
• https://github.com/RalphBacon
• https://buymeacoffee.com/ralphbacon
------------------------------------------------------------------
My ABOUT page with email address: / ralphbacon