ChatGPT absolutely DOMINATES Arduino programming

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey what's up marcobank Kev here so as everyone's been talking about open AI I wanted to give it a try in the embedded world because I've been seeing lots of posts of people from the python Community from the databases um from the web development but I've yet to see someone from the embedded world so I just registered myself and this is my first try as you can see I just made the blink circuit and let's ask the AI to write the code for us so right um so quite easy the this is just the Blinky example void setup okay so I think this will have no problem doing it thank you so pretty good uh it even gave an an additional example of how you would delay it for just half a second and obviously this is correct so let's just copy and paste it and upload it here and as you can see it's blinking correctly every half every second okay so something a bit more difficult let me think of a new Excel of a new challenge for the AI and I'll get back to you okay so I just made a somewhat more complicated circuit now I'm going to ask the AI to use these potentiometer connected to pin a0 and make it either brighter or dimmer using a pwm signal this is also an example for Arduino for the typical Arduino examples but I think it's a bit more complicated so let's give it a try so write an Arduino program that controls a LED in P9 via a pwm signal by means of a potentiometer connected to a0 so let's see how it does so yeah pretty good the setups is okay the pin modes are okay and it simply stores the analog Grid in the in a pod in an integral value that then writes in here in the B9 so let's try it out go beyond paste and click upload compiled okay and let's give it a try [Music] as you can see it forgot to divide the analog grid uh by 4 because I I'm not sure but I think that you get a value of around a thousand in analog during that analog read and the analog write isn't a only has like a 256 resolution so that's why I'm getting like four deep seam brightness here but anyways that's pretty good let me think for a bit and let's make a somewhat more complicated example next circuit I just wired up a Servo motor to P9 and I'm just going to ask to sweep the holes the whole uh Servo motor every three or four seconds so let's ask the AI so right on our Arduino program that sweeps the whole range of a Servo every 4 seconds I think this is also a example for Arduino but I think it was uh worded a bit differently okay so it included the sweepinter it seems to be okay so yeah I think this will compile perfectly too another win for the open AI so I think we're going to have to make it a bit more difficult and not just go for the most simple effects of examples from Arduino let me think of another circuit and I'll get back to you okay so next circuit I put a OLED screen with i squared to Communications and I'm going to ask the AI to write a the average temperature of Spain in uh in here okay so let's get back to the AI and write an Arduino program that displays the average temperature of Spain in an i squared to OLED screen with an address of 3D let's see how it does so I think this sketch is completely perfect I don't see any mistakes here yeah I love the comments like if I was beginning uh an Arduino beginner I'd love to have all these comments here because I remember like forgetting what the instructions did and I mean the average temperature he the AI just assumed the average but everything is uh perfect I think this will compile on the first try and upload so perfect uh I have no words Let's uh let me think for a bit and make a somewhat more complicated circuit okay next idea I just wired up an adxl three four five uh accelerometer here this is one of those uh modules that you get with Arduino that I've never tried I have no idea how the libraries are I just downloaded a bunch of libraries on the Arduino so uh it's uh easier to compile and we don't lose so much time and I'm going to ask the AI to display the x value of the accelerometer here in this screen so let's get back to the AI okay so write an Arduino program that displays the x-axis of an avxl345 accelerometer with address 0x53 in an i Square t OLED screen with a 3D address I I think this is a bit more complicated like I'm quite used to Arduino but I think this doing this would take me around one hour or two uh two hours at most let's see how the AI does okay so at first glance I see that the here he cast the adxl library as adxl345 and here it says avxl 345 underscore U h as I said I've never worked with these uh module for the Arduino so I'll just try to do a easy copy paste uh verify first because I don't think this is going to compile oh my God it compiled I I thought this Library didn't exist I mean I just downloaded a few libraries where it said adxl 345 but I guess one of those libraries was this one so let's click upload foreign I can't believe it oh my stupid hand ah the wires are a bit flimsy so but you can easily see that if it's working perfectly ah it it got crazy again I'm extremely impressed with the AI like uh I said that this doing this would take me a couple of hours and I consider myself an advanced Arduino level uh but wow look at it's doing the inclination perfectly I can't move it because ah let me try it a bit three I guess this is like uh I have no idea what what units this is using but yeah you can see that it's working perfectly [Music] amazing like uh I didn't expect this to do so good uh I'll think of some additional circuit but I'm impressed so last circuit I was searching around my house and I had I don't have any more complicated circuits Arduino modules here at my house uh by a because I I didn't even have any idea that the AI would be able to display uh the accelerometer here so I I mean I thought the this video would end with the second test of the potentiometer and the pwm signal but uh here we are so I have a buzzer and I'll just ask the AI to write a song or to do something uh funny with this buzzer okay so write an Arduino program that plays Smoke on the Water through a buzzer in P9 okay so first here I can see that it forgot the library where all of these nodes are defined but uh I can easily find this Library so no problem okay so it seems that the AI got stuck here let me try it again foreign [Music] seems to get stuck when it's like a huge code but okay let's ask for a different song [Music] um [Music] it's dark again let's try with classical music so it seems that it forgot to add the I think it was tones Library I'll just copy here and let me search for a bit what was the name of that library but yeah it keeps forgetting to add that Library [Music] okay so I Googled for a bit and the library is called peaches.h and I just copy and pasted the pictures there and let's see if it works [Music] [Music] that's not a classical music but okay let's try again [Music] so to be honest I'm extremely impressed with the AI I was sure that it would do the blank example the pwm example I wasn't so sure of the servo and the the thing that impressed me the most was the OLED library and the adxl I didn't expect it to even to light up the OLED screen but it did and but it's been like an hour and I've been asking the AI to do the same example and then it was just giving me some garbage it told me to use a weird library that it doesn't exist and like some small details that it wasn't getting correctly but overall I'm like extremely impressed with this Ai and I'll keep trying some other examples not maybe I'll change to in esp32 maybe I'll use the their firm framework with the AI which is like uh ma it is it it doesn't have as much information as they Arduino Library so I'm not sure that it will be as good as with Arduino so that's all for now and thanks for watching
Info
Channel: Hanqaqa
Views: 223,975
Rating: undefined out of 5
Keywords:
Id: 3cJ7_qCY7R4
Channel Id: undefined
Length: 18min 46sec (1126 seconds)
Published: Sat Dec 10 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.