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
1st_ChatGPT_Webserver.ino
//After debugging; 1st ChatGPT Webserver and refinements:
//by William Lucid
Webpage, monitor view:
Regards,
William
Good Morning,
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.
Results of 2nd ChatGPT session
Debugged and combined working Google Sheet Script using #5 input from “Results of 2nd ChatGPT session.”
GS Script and Arduino function that sends data
Work in progress…
BME280 Data Logging –live data feed
Regards,
William
Hi Sara,
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.
Regards,
William
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!
Regards,
William
Good Morning,
Article on using ChatGPT with Arduino:
I tried ChatGPT for Arduino – It’s Surprising
William
Good Morning,
Old code for BME Data Logging was failing to advance to the next month. Decided to give Google’s Bard a try at simplifying and fixing code. This is the simplified code:
Gist of BME280 Logging Google sheet script
William