Instructing ChatGPT to generate C++ code
In this section, we will direct ChatGPT to produce C++ code on ESP32, using the well-designed application logic diagram and the hardware pin wire connections as effective prompts.
After you have carefully reviewed the diagram, understood the application logic, and familiarized yourself with the ChatGPT prompts outlined in Chapters 6 and 8, you can create custom prompts. These prompts will instruct ChatGPT to generate code in accordance with your application logic.
The following is a prompt example to instruct ChatGPT to generate code according to your application logic:
Hi, ChatGPT,
Role:
You act as a senior software developer with expertise in embedded development, specifically with IoT projects using the ESP32, Arduino-compatible sensors, and
AWS Cloud.
Task:
Your task is to mentor a high school student (like me) who has a basic understanding of Python and is new to C++. I need you to develop a comprehensive code snippet...