ChatGPT with Arduin...
 
Notifications
Clear all

ChatGPT with Arduino and ESP32 | C++ and MicroPython coding

37 Posts
7 Users
4 Likes
2,562 Views
(@dronebot-workshop)
Workshop Guru Admin
Joined: 5 years ago
Posts: 1079
Topic starter  

See how ChatGPT can write C++ and MicroPython code for an Arduino Uno and an ESP32. You now have an AI-Assisted coder to help you with your projects!

On November 30, 2023, OpenAI released ChatGPT, an AI-powered chatbot. The reaction has been phenomenal, and for a good reason - ChatGPT’s human-like responses often seem like the stuff of science fiction.

ChatGPT is so good that it, and other technology based around the same GPT-3.5 Language Model, could seriously jeopardize many people's jobs.

And that might even include programmers and developers! Because ChatGPT is equally adept at writing code as it is at writing essays.

As a tool, ChatGPT is remarkable, and it really offers a lot of advantages to makers and hobbyists. Imagine having your own personal coding assistant on call 24 hours per day. Well, now you can have that with ChatGPT!

I’ll show you how to use ChatGPT to code in both C++ and MicroPython, using an Arduino Uno and an ESP32 module. We’ll start off small and then move up to building a Temperature & Humidity Meter, a WiFi Scanner, and a MicroPython-based ESP32 Web Server.

Here is the Table of Contents for today's video:

00:00 - Introduction
01:48 - ChatGPT
09:57 - Getting started with ChatGPT
12:06 - Arduino Uno Hookup
14:34 - Blink
16:31 - PWM LED Dimmer
18:34 - ChatGPT Code Correction
19:58 - ChatGPT "Forgets"!
22:14 - DHT22 Temp & Humid
24:48 - OLED Display
26:38 - Temp & Humid Meter with C/F
31:12 - ESP32 WiFi Scanner
33:47 - ESP32 MicroPython Web Server
36:29 - ChatGPT vs. GitHub Copilot
38:49 - Conclusion

While I don’t think that ChatGPT will be replacing coders too soon, it is a valuable tool that will really assist developers and makers in improving their code and reducing their coding time.

Also, please note that this video (and its accompanying article) were created at the end of January 2023, about 8 weeks after the release of the public beta of ChatGPT. It’s very likely that new features will be added, and ChatGPT Pro will be released soon. Keep that in mind when you watch the video in the future!

Hope you find it useful.

Bill

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
Lee G and robotBuilder reacted
Quote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6964
 

I remember the first efforts with Prolog and at the time I was not impressed but the high speed/low cost processors today make many things possible. I recently watched Elvis Presley singing and the image was very convincing. What is far more concerning is the ability for these 'things' to write opinion pieces. What we saw since 2016 in the US political arena is the thin edge, it will continue to get 'better'.

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2042
 

@dronebot-workshop

Very much enjoyed this video I love your presentations and the way you explain things.

 


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6964
 

@dronebot-workshop I am trying to create an account and get a message "The email you provided is not supported.". What is even more bizarre is if I use the same username but different domain I get a message that the email address is in use. No idea why this is happening.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6964
 

Just some FYI

The field of AI research was founded at a workshop held on the campus of Dartmouth College, USA during the summer of 1956.

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6964
 

I didn't get the original error today, but now I am waiting for a confirmation email. If it's this hard to get logged on, not sure why it's so popular, or it knows I am the enemy and it is blocking me.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6964
 

@dronebot-workshop Hi Bill, I still can't get logged into chatGPT, the error is 

The email you provided is not supported.

I have tried with several different emails but always get the same error. In one case I did get the verification email but it then failed on Could not be verified.

I would really like to try this beast but I am stymied! Did you have any problems like these, if so how did you resolve them?

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1680
 

Hi Ron @zander ,

  I haven't got much further than watching Bill's (excellent as always) video, but when I started to trawl the documents I noticed this in the FAQs.

https://help.openai.com/en/articles/6613629-why-can-t-i-log-in-to-openai-api

Just in case you hadn't seen it and there was something helpful.

Best wishes, Dave


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6964
 

@davee That is the most insane help I have ever seen. I wonder why they didn't also recommend buying a new computer or changing my socks. I don't understand some of it and have no idea how to do almost all of it. My concern is the part that says 

a security add-in or extension can occasionally cause this type of error.

does this mean they want us to use it with no security? Hawking is looking more and more right.

 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1680
 

Hi Ron @zander ,

  Sorry, I am only trying to be a helpful messenger ...  I only sat down for a while to catch up with Bill's video, then thought I would try a quick explore.

Whilst Bill's video looks calm and straightforward, subsequently looking at the website, I came away with the feeling that Hitchhiker's Guide to the Galaxy had the right idea ... (i.e. Deep Thought, the computer programmed to calculate the answer to the Ultimate Question of Life, the Universe, and Everything produced the answer "42",  but it needed a far more powerful computer to find the ultimate question ... 🙄 )

Which in the current context  became  "Where do I find an AI system to navigate and explain the ChatGPT documents?".

To be fair, I have only spent a few minutes mouse clicking, but Bill made a lot more sense!

--------

As for your last point, "anti-virus" and related "anti-something" programs have been accused of causing errors from the earliest days of such products, sometimes with legitimate cause (when the anti-xx flagged a false problem), but often as a cheap way of avoiding blame for something that doesn't work reliably. Sorry, I have no idea which category your quoted comment belongs in.

Best wishes, Dave


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6964
 

@davee No need to be concerned Dave, I know you are just trying to be a helpful messenger. I will try yet another email address but in an incognito browser since I do have a lot of 'security' goodies (NON of which are anti-virus as that is built into all modern OS's)

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1680
 

Hi Ron @zander,

  Thanks for the reply.

  I tend to use "anti-virus" as a generic umbrella term for all security add-ons  - simply because I can't think of a better one that everyone knows.

 I noted the FAQ talks about "Ensure that you are using the correct authentication method." and "Your account can only be authenticated if you log in with the auth method that was used during initial registration. ", etc., which suggested a rather fragile environment.

Good luck, Dave

 


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6964
 

@davee I see that stuff too, but I have no idea what it means. I just got another id to the point it sends the confirmation email but then it breaks. I have noticed it hints at only certain browsers, and certain email systems are supported. Maybe I will try edge and a new microsoft email account.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6964
 

@davee I got it to work by installing a new browser (Edge)  and grabbed a new Msft userid. I just received my first python program that the AI wrote.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 6964
 

I just used it to create a class. Very basic so far, but now I can try to modify it and maybe produce something useful. That will happen when I learn to speak 'class'

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Page 1 / 3