I Asked ChatGPT To Write Arduino Code in 2023 (THE RESULTS WILL SHOCK YOU)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so I've been seeing a lot of people lately using chat gbt software to actually write code for website or ask a question or solve a specific topic for example but I have seen nobody actually using it to write code for an Arduino so this is what I'm going to show you today in this video so if you go to the website of openai.com you can click and try the research version of chatibility which is actually a very Advanced chat bot uh which uses deep learning models to actually use a lot of data on the end on the internet to come up with the perfect answer so it's actually able to write code for an Arduino for example so let's say if you don't have any experience with Arduino and you don't know how to start the first thing you could for example do is you can ask it to write a script to blank the lets of the Arduino so for example you say like write a Arduino script to blink a lot so it will actually come up with a decent script which you can copy a paste into the Arduino IDE so yeah it's actually using the constant and netbend 13 for its setup it's using the pen modes it's using void Loop which will use digital right to actually trigger the lead pen high and low with a small delay inside and it is actually giving some little uh explanation with it to so if we go to this code and actually copy it I would go to Arduino and just paste it in here and we compile it it takes some time so you can see it's actually compiled perfectly so that means there are no mistakes in the code so for example if we want a little more complex code so you have started out with some projects by yourself or using jet GPT and now you want to make a self-balancing robot for example so just the same thing has as previous example write a code for a write a Arduino codes for a self balancing robot so again it comes up with a all the included libraries you need Adafruit sensor I mean by a moon matte so it's actually using an inertial measurement unit and the required math to calculate the integral derivative terms so if if this code is actually not uh really Satisfied by you it's very simple you just can click after the code is finished to regenerate the answer so what you also can do for example if you don't want to use all these complex libraries you can't just type in after the code is finished like don't use the other fruit sensor library for example I cannot can show you that in a minute so you see it's actually finished already so it uses uses the the output equals the proportional term times the error plus the integral term times the integral plus the derivative term times the derivative um so yeah at this it's actually using a PID control theory to come up with the self-balancing effect and that this actually giving again some little explanation so you see it's a it says you can attach the piano uh 055 sensor to the algebra C bus and the motors to connect to pin 9 and 10 on the Arduino board so again if we go to the top of the codes we can copy it go to Arduino and after you have installed the the libraries you need you can actually compile it again and yeah you see I don't have this Library installed for example so if I say now regenerate the code but without libraries all right so it's now using the SDA and scl pins um making some double terms for the kpki and KD so set point previous error and crawl output motor constants okay interesting so you can see for for every uh question you ask the the chat gbt it can come up with a different totally different answer but with the same outcome so for example a very simple code like blinking a let is not very complex for this AI to solve but a more complex code like self-balancing robot you can use a lot of different uh libraries or codes or strategies to control this this robot so you see it's typing all the codes manually without using any Library which could make our work a little bit easier but we are lazy I guess and we don't want to install all these libraries because we can just use the chat gbt so you see again it comes up with a very good looking code with a little explanation again and for example it says again it uses the sensor it's uh that used before in the previous code so if we say rewrite a bit don't use the 055 sensor so it actually comes up again with the same example but now a different code because it's it's using another sensor so it's just using an analog input for the gyro still using the PID values so yeah that's the really the power of this uh of this tool you could eventually use it like for all your problems asking it to write a little game for example uh or or write bytes and scripts or um writing for example a website plugin for your WordPress website which I have made a few another tutorials about on my channel so you could have a look about to that here it actually this is funny this code is similar to the previous version but it does not use the Sims or to measure the angle of the robot instead it uses a gyroscope connected to the Arduino board to measure the angle okay that's interesting gyroscope should be connected to an analog inputs bin for example a0 so it's actually writing the code and at the same time uh perfectly explains you what to do and what to connect to your Arduino on watch bands so it couldn't be easier than this but so uh yeah in the future I will do some new tutorials about other Concepts but this just shows the power of this jgbt tool and I'm only scared to to think about what this could bring in the future because it looks like a lot of jobs could be replaced in the future but uh let's just keep it positive for now and if you like this video please consider subscribing to the channel and let the yeah let me know what you want to see next time
Info
Channel: Simplified
Views: 11,111
Rating: undefined out of 5
Keywords: arduino, chatgpt, tutorial, software
Id: rHiiYMVU_ok
Channel Id: undefined
Length: 10min 6sec (606 seconds)
Published: Mon Jan 02 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.