Getting Started With ARDUINO UNO With Python Language | All In One Code

If you know raspberry, you know arduino its a mini version of raspberry pi, but its a quite of different. So in the todays section, im gon na show you how you can start with arduino and how you can use the python programming language in arduino. So lets begin. So this is my arduino uno. I bought it in 480, rupees or something or if you have arduino in your hand, so just connect the arduino code in your arduino and in your laptop or pc. Now, when you plugged in your arduino in your pc, youre gon na see the update, arduino driver so now lets move on to our pc, so first open the device manager and in the device manager in the port section, you can see the arduino uno. If you dont see this just update the driver or reload the device manager now just go in the arduino official site link is in the description go in the software and in the download. Now you can download any version you want. If you want to download zip, you can download zip but im gon na download the installer. So just wait for the download. If you want to contribute donation, you can just click here or else just download, so when its complete downloading just open and install this okay. So this is my arduino ide in here. You are gon na see this word setup and void loop. Now, if you know cc plus plus you know what is this, so this is nothing but the ide like pycharm in here you can see the c language.

Now i know c language so word setup is nothing but the or main area where we can create the code. But we are gon na use the python, but first lets see or arduino is connected or its working or not, and for that just go in the file, examples, basics and blink. Now this is nothing but the mini program. It is gon na blink, your arduino led. So, as you can see in here, this is the c chord in the void loop. You can see digital right led built in high high means turn on light and low means turn of the light. So in the delay section you can see, one thousand one thousand means one thousand millisecond, which means one. Second, if we change the speed – or you can say, delay to 5000, so it is gon na hold for five seconds. So lets try this. I just changed it into 6000. Now lets go in the verify button, so click on the verify, so it is gon na compile your code and check it first now, if you know see you know what is this, we are first checking the or code we are compiling our code and, as you Can see sketch use 932 byte of program storage space. Maximum is three two two five six bytes we just got three two. Two five, six bytes global variable used nine bytes, zero percent of dynamic memory, leaving two zero. Three: nine byte for local variable maximum is two zero.

Four eight bytes. Now, if you dont wan na go in the memory part you can skip it or compiling is done just go in this arrow button, upload and click on it. So, as you can see, this is working perfectly fine. First, three light is blinked and this light is blink for six. Second, okay, its turn off now and blink again. So, okay, it means this is running perfectly fine. So now you can close this so now. The question is we dont want to use c language. We want to use the python programming language so how we can do this. First of all, this is just an ide. Now, if you dont you dont want to use this ide, you can use the online arduino. Ide link is in the description again. This is just an id. So first we are gon na install some library in our id, so we can use the python programming language and for that just go in the example, communication and physical pixel. So this is the physical pixel code. If you want to read it, you can read it but skip if you want compile this code and upload, it first compile and then click on the arrow button upload. Okay, its done now open your pc command, promote. First, you have to install this serial. So obviously the code is pip install siri and hit enter. I already installed this now we are gon na use the python code to blink or raspberry pi led light.

Sorry arduino led light. So lets begin now you can use another dot pi file, but im gon na show you in the command, promote so just hit python now, first of all import serial and time now, if you dont know anything about python, so just check out my python series. Now i just created this serial number serial number is nothing but the common number scr equal to serial dot, serial com4 and 9600. So this is from this method. Im gon na get my serial number. If you wan na see, you can just do like this acr dot name at hint enter, so you can see. I got com4, which is my serial name now you can use the time dot sleep method and enter the second to hold on for that moment. So you can blink your light, for example, when i click type dot sleep and pass the two. So you can see this is gon na hold for two second, and its done now lets turn off and turn on light. So this is the code for turn on and turn of light acid.right b, h, h is string, h means high and l means low. So if you enter the edge, it means it is gon na turn on and if you enter l, so it is gon na turn off so lets. Try you can see, i got one, it means it turn off so return on and when i click on this here dont write, b, l, it means it is gon na turn off.

So you can see this is perfectly working so thats how you can use the python programming language in or arduino. So that is it for you guys guys if you like. My video, just like my video share this video with the third programmer write in the bell. Icon so youll never miss my latest video.

Share.
Exit mobile version