WEBVTT

00:00.330 --> 00:02.620
Let's understand how things work.

00:02.940 --> 00:10.170
So if you remember, we have 600 pins on the argument, the number for those pings goes from a zero

00:10.170 --> 00:11.070
to a five.

00:11.730 --> 00:17.940
Note that on other types of around the world, you may also have a different layout, a different number

00:17.940 --> 00:22.810
of Europeans that if you understand this lesson well, it would be easy for you to find it.

00:23.340 --> 00:32.010
And one thing you can notice here is that is not just an analog underpins its written analog in which

00:32.010 --> 00:33.730
means analog input.

00:34.170 --> 00:42.180
So by default, the analog pings on the original are set as input beings, which means that in your

00:42.180 --> 00:44.970
code you would not have to call the pinboard function first.

00:45.420 --> 00:49.530
You can just use directly the analog been to read values from an analog sensor.

00:50.010 --> 00:52.920
Now, how does it work on the Andrina?

00:53.310 --> 00:59.430
When you read data from an analog input pin, you will get an integer value between zero and one thousand

00:59.430 --> 01:00.010
twenty three.

01:00.390 --> 01:04.830
This number will be determined directly from the voltage applied to the pin.

01:05.190 --> 01:11.580
So an analog sensor like you put on Showier, which is basically a valuable resistance, will simply

01:11.580 --> 01:16.770
apply a different voltage on the other being from zero to five volt.

01:17.240 --> 01:23.300
The Orange Bowl will read this voltage and translate it into an integer number.

01:23.610 --> 01:26.520
So four zero volt you will get the value.

01:26.720 --> 01:30.920
Zero or five volt you will get one thousand twenty three.

01:31.230 --> 01:34.170
And let's say that the voltage is three volts.

01:34.380 --> 01:39.870
So three volts is 60 percent of five volt, which means that you will reach the value.

01:40.050 --> 01:41.790
Six hundred and fourteen.

01:42.090 --> 01:48.630
Any other value between zero and five volt will give you a value between zero and one thousand twenty

01:48.630 --> 01:50.550
three in your program.

01:50.550 --> 01:56.650
You can directly use these range of integers, which will be easier to process than voltage numbers.

01:57.270 --> 02:00.590
So that's how analog input beings work.

02:01.230 --> 02:03.900
And now this is an important addition.

02:04.110 --> 02:10.050
And it may seem weird, but you can't use the analog right function on an analog being.

02:10.500 --> 02:17.700
The analog right function is used on only some digital pins which have a B.W. and functionality in order

02:17.700 --> 02:20.970
to right an analog value to actually do so.

02:20.970 --> 02:26.640
The choice of the name of the function from the developers of the original library was maybe not the

02:26.640 --> 02:28.200
best choice for clarity.

02:28.500 --> 02:33.120
Just remember that you can't use analog right on things.

02:33.360 --> 02:35.810
You can only read analog values.

02:36.150 --> 02:37.070
You can't write.
