Purpose.
I just download the code from GitHub that is available over here.
I expect this inside the my python code.
Okay.
This is my sketch.
This is available in this file you just downloaded from GitHub.
Open it.
Go to the sketches over here.
You just find out.
Prototype.
Just open it.
Just connect your Arduino with your PC.
To find out the composer.
Just go to the device manager.
Open it in.
The device manager.
You just find out your home port inside the ports.
As you see over here, I'm using Windows 10 inside the ports over here.
This is my home port that is home.
It just shows it.
So this is the code you have to first bind to your Arduino before Python program.
So setup in the tools.
Just get the board is already know AVR boards.
I just use Arduino Uno and the home port.
It is already set.
You just need to set these settings after this.
Upload your code over here.
This is your verify over here it is your upload.
Just upload it.
It will take hardly.
3 to 4 seconds.
I've done very fine right now, as you see.
It is compiling the sketch.
When the code is uploaded to your Arduino, it's over here and in both blink and check.
So right now, uploading is in the process.
So as you see, uploading is done.
You just close this.
You just go to your idle.
Well, here, this is my python.
Three point 11.4.
It is 64 bit, so I will tell you how to.
Hello, friends.
Today I will tell you how to acquire digital signal using python code with the help of Arduino.
For that purpose, first you have to import.
You already know.
Import.
Already know after this.
You just.
And folk time also in this case because.
In this case, if you are not using time, the signals speed is very high.
Or you can say you can see of importing or acquisition is very high.
So import time.
Then you have to just set up the board.
Mode variable name is there.
Arduino code rate is 9600.
Then you just.
Set up the court and the court is my.
Home.
Eight.
So this is my setup.
Now you have to just.
Set up the mode that is input mode in this case.
So mode dot.
Arduino, not Arduino.
It is a pinmode.
In more.
So first you have to set up the pin.
Let's say in my case, I'm just using 11 pin.
Then you have to just set up the mode is this mode is input mode.
Because I just want to read the signal in the case of Arduino, both the.
These digital twins were here.
Total number of 13 digital twins are available.
You can use these 13 points as input or as output.
It is up to you.
So now I just use while loop over here.
So why?
Because I want to set up.
It's more time also.
True.
While it is true when the condition is true.
A variable.
Is there another variable?
It will grab the data from that pin.
That is pin number 11 board.
Dot digital read.
Digital read.
In this case.
You just said the PIN number.
In this case, it is 11.
Now, if you want to check out the word value is there for the PIN number 11, you just print it.
Print A because A will contain the value and now the function of time is there.
So time dot sleep or here I just put the time in seconds, so I just put 0.5 seconds.
So just save it.
Now go to the hardware part.
So I just use two pins.
So one is my VCC.
So this is my five volt signal that is equivalent to one.
And over here, this is my ground.
So now I just use one pin for.
11th win.
This is my over here.
This is my 11th win.
And the blue one is my positive win and green one is my ground pin.
So I just initially connect 11th pin with the high signal.
Let's check what happened.
So save it.
Run it.
When you run it.
As you see over here, you got the value.
One, one, one.
After every.
Point five seconds.
So when you remove it and connect ground to it, let's check over here.
As you see, zero zero is present at the.
I really sell.
So this is how you can read digital signal and using with the help of Arduino.
So this is all about today's lecture.
Thank you.