So this is what Im 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 its actually able to write code for an Arduino, for example. So lets say if you dont have any experience with Arduino and you dont 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 its actually using the constant and netbend 13 for its setup, its using the pen modes, its 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 its 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 its 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, its 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 dont want to use all these complex libraries you cant just type in after the code is finished like dont use, the other fruit sensor, library, for example. I cannot can show you that in a minute, so you see its 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. Its 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 its 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 dont have this Library installed, for example. So if I say now, regenerate the code but without libraries, all right so its 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 its 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 dont 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, its uh, that used before in the previous code. So if we say rewrite a bit, dont use the 055 sensor.

So it actually comes up again with the same example, but now a different code because its its using another sensor so its just using an analog input for the gyro still using the PID values, so yeah thats 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, thats interesting gyroscope should be connected to an analog inputs bin, for example, a0. So its 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 couldnt 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 Im 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 lets just keep it positive for now and if you like this video, please consider subscribing to the channel and let the yeah.

https://www.youtube.com/watch?v=rHiiYMVU_ok