Can ChatGPT program an ESP32? This was the inspiration to Try ChatGPT
ChatGPT requires an account on OpenAI; programing is done using your web browser. I typed in: “Create Async web server using Tyler Glenn’s BME280 and EvironmentalCalculation libraries with sensor readings every 15 minutes using NTP..”
1st ChatGPT Web Server
//Written entirely on OpenAI using ChatGPT
//See 1st_ChatGPT_Webserver.ino –after debugging and refinement
//by William Lucid 1/21/2023
//After debugging; 1st ChatGPT Webserver and refinements:
//by William Lucid
Webpage, monitor view:
I already have BME280 webserver uploading data to a Google Sheet; wanted to see what ChatGPT could come up with for uploading data for a year by the month and adding a new sheet for the same month if append row fails.
Debugged and combined working Google Sheet Script using #5 input from “Results of 2nd ChatGPT session.”
Work in progress…
Here is 1st text I entered in ChatGPT: “program esp32 async web server with bme280 reporting every 15 minutes using ntp” –no quotes. ChatGPT return on the text you enter; as to how well it does. It also explains the resulting code.
2nd text input: “change Adafruit_BME280 library to tyle glenn bme280 library”
3d text input: “add tyler glenn evironmental bme280”
4th text input: “add tyler glenn EnvironmentCalculations
5th text input: “use tyler glenn bme280 and EnvironmentCalculations libraries”
6th text input: “create async web server tyler glenn bme280 and EnvironmentalCalculations envCalc libraries with sensor readings every 15 minutes using ntp”
Each text input produced new code. The more complete the text the better the results… Still required some debugging and changing variables due to switch libraries I think… still awesome; taking text and writing Arduino C++ code.
This was my first experience using ChatGPT.
I believe there will always be a need for a strong foundation like found here and in your courses in programing. How else could you debug code, when the AI “tool” fails to generate 100% correct code or code that does not compile?
Yes, RNTLab is needed; keep up the good work!