Using ChatGPT to write Raspberry Pi Python code

preview_player
Показать описание
How to use ChatGPT to write Python code on a Raspberry Pi. Video demonstrates generating, running and editing code to control LEDs and servos connected to GPIO pins, as well as generating Python code to control a Raspberry Pi camera. But the method shown will work for any type of program, subject to the capabilities of ChatGPT . . .

My previous “Raspberry Pi Servo Motor Control” video is here:

And I have a video about Raspberry Pi OS Legacy and camera support here:

Raspberry Pi OS Legacy -- which supports the camera commands generated by ChatGPT -- can be downloaded here:

And I have a recent video called "Should we fear AI?" here:

For additional ExplainingComputers videos and other content, you can become a channel member here:

More videos on computing and related topics can be found at:

Chapters:
00:00 Introduction
00:37 Embracing AI
05:34 Green Cylon
09:35 Servo Action
11:41 Camera Control
14:47 Wrap

#ChatGPT #RaspberryPi #Python #Linux #explainingcomputers
Рекомендации по теме
Комментарии
Автор

As a (now-retired) professional programmer, I've lived through the progress from hard-wired logic panels & keypunched card decks to online interactive programming. Thanks to AI, we're now approaching the point where we can ask the computer a question, then get the answer without writing code at all.
Thanks for the work you do, gathering information & putting it into yet another understandable explanation of a complex topic.

MarcusPHagen
Автор

Several months ago I watched a video where a guy built an entire job board website from scratch using ChatGPT. Part way through his video he didn't like the fact that everything wasn't centered on the screen so after a few attempts at explaining to ChatGPT that he wanted the text and tables centered on the page, it provided the results he was looking for. The entire website, including databases, took him about 5 minutes to put together. Mind you, he is a really good website developer but his intention was to show that both human and AI can collaborate on a single project together, which I thought was really neat. The video also demonstrated the conversational nature of human and AI interaction. So, in a way, it was like the AI was tasked to come up with a specific website, and he was like the boss who approved or disproved of the AI's job performance.

bigsky
Автор

Wow! My 'Wow!' is for what chatgpt can do (writing perfectly serviceable short snippets of Python)...
...and my 'Wow!' Is for how clearly YOU presented, step by step, the use of chatgpt to write Python code for the Raspberry Pi.
Great job!

KenSkier
Автор

Thank you Chris. I am pro coder with 40 years of experience. I use Microsoft Copilot and ChatGPT every day and my productivity is now x10. Copilot is very impressive, you don't write a lot, the system do it for you, sometimes giving you a better way to do the thing, and ChatGPT is not like google, an search engine, but is is a response engine. I mean, there is a lot of bs on internet, plenty of people who don't know the answer but they post just for posting. It generates a lot of background noise and it is now difficult to find correct answers. Chat GPT give good answers, despite the fact it is not always accurate, but you got the idea and have to finish the job. Anyway, less google and more Chat-GPT, it changed my coder lige.

renobodyrenobody
Автор

You saying 'please' even to an AI speaks volumes about the quality of your character. Once again, for the people at the back - best channel on youtube right here.

chrisblumarten
Автор

Love this man! I am pure electronics and sensors guy but I started feeling the importance of coding in all the industries. With the help of chatgpt and tips from him, I am able to solve difficult tasks very easily!

vishwanathsharma
Автор

I've done a few functions in python using chatGPT and it's a great way to discover available modules.

DevilsHandyman
Автор

Another excellent video Chris!
I've used ChatGPT to create programs and found it to be really useful. However, one program seemed to work fine but a couple of weeks later I was getting really stuck. Tracing through the code I found the problem - a small error in the code it had supplied. I ended up spending more time than if I'd written the code myself.
Moral of the story, make sure you check the code that it gives you, even if it seems to work fine.

Trevor
Автор

I've been using ChatGPT to assist in writing python code for months now, it doesn't always get it all right on the first try, but you can feed it errors, it will modify the code accordingly.. very handy, it has sped up development drastically.
Thx

dragonsage
Автор

I asked ChatGPT to write a comment on this video and here is the result:

Title: Captivating Performance! A Masterful Blend of Emotion and Skill
Comment:
Wow! I am completely mesmerized by this incredible performance. The combination of emotion and skill displayed here is truly remarkable. From the moment the music started, I was captivated by the artist's ability to convey such depth and intensity through their playing.

The artist's technique is flawless, and their musicality shines through every note. It's evident that they have dedicated countless hours honing their craft, and it truly pays off in this performance. The way they effortlessly navigate the instrument, producing such beautiful and nuanced tones, is a testament to their exceptional talent.

But what truly sets this performance apart is the emotion poured into every phrase. It's as if the artist is telling a heartfelt story through their music, and I find myself completely drawn into their world. Each passage is imbued with such raw emotion that it sends shivers down my spine.

Furthermore, the video production itself is outstanding. The close-up shots of the artist's hands on the instrument allow us to witness their intricate movements and the sheer passion they bring to their performance. The lighting and overall atmosphere of the video perfectly complement the mood of the music, creating an immersive experience.

I am grateful for the opportunity to witness such a breathtaking performance. It's a reminder of the power of music to move and inspire us. Thank you to the artist for sharing their incredible talent with the world, and to the creators of this video for capturing it so beautifully. This is a performance I will remember for a long time to come.

👉Biological intelligence tells me: It's been proven that we shouldn't blindly rely on artificial intelligence.🤔

Thank you Chris for this brilliant idea to make Python coding easier to get started with. I just tried out ChatGPT and MicroPython on my RPI PICO and I love it.

tubegor
Автор

Thnx for another great video!
I finally registered for ChatGPT after watching your video called "Should We Fear AI?" The first thing I asked it to do was write a Python program that calculates square roots using an iterative algorithm (instead of the built-in library). It did a better job than me, because my script often turned into an endless loop, but the chatbot's script never did.
Now this morning, I registered as a user of Bard (the Google competitor of ChatGPT) and a little bit later, this video came up. What a nice coincidence!
🙂

Justin-Case-.
Автор

I've recently started programming with Micropython as a hobby, and ChatGPT has helped me a lot, for both, learning Micropython, and writing me some codes I wasn't capable of. It's even capable of writing codes for creating web pages on Pico W for wireless controlling sensors, devices, etc. It still has a lot to improve (it won't do well with a lot of complex tasks, and sometimes makes mistakes on very on some very simple tasks), but anyway, it's amazing what it can do at this point.

MrSlowFloww
Автор

I laughed out loud at the matter-of-fact way you mentioned losing your resistor in the carpet. Excellent video - thank you

chirpybee
Автор

That was a fascinating example of using ChatGPT. The dancing hamster wasn't half bad either. LOL. Looking forward to your next video!

perrymcclusky
Автор

The only thing needed is a RasPi generated voice saying "by your command" LOL. This was both educational and entertaining Christopher! Thank you!

kkdj
Автор

My very first encounter with ChatGPT was to debug my existing Python code that I wrote for monitoring my Home Monitoring system on the Pi. After 2 attempts by ChatGPT it got it right and I have been using ChatGPT ever since late last year. It cuts my programming time a lot, but I still need to make necessary changes to its code to meet my needs. Great Video... again

donaldhoudek
Автор

I don't know whether to be excited or shocked at how well ChatGPT has done with these examples. Thanks for sharing Chris as very informative! 👍

Razor_Burn
Автор

Amazing video as usual Chris. AI is both slightly scary and amazing at the same time. How far we have come is incredible and it will be interesting to see what happens over the next few years. 😁

jinty
Автор

You've just inspired me to try using chatgpt to fix a problem. I spent ages trying to find a batch script to zip up multiple folders into individual zip files and change them to cbz so I can store my comics as one file each. Using this I was able to get to the solution that took me hours to find and get it in minutes. Even better I asked it to add stuff like deleting the folders after zipping and now I've got a better script than the one I found. That said I know I have to be weary trusting batch scripts as they can do all sorts of damage but chatgpt explained each line of code and what it does so im very happy.

jjk-
Автор

I have been avoiding ChatGPT since it was made available. I was just not interested…until I saw this video on Explaining Computers. I knew Christopher would give us a excellent review of ChatGPT on a Raspberry Pi and I wasn’t wrong. I feel this is something I can use, not only for learning more about Python, but also PowerShell.

alansmart