Let's understand how things work.
So if you remember, we have 600 pins on the argument, the number for those pings goes from a zero
to a five.
Note that on other types of around the world, you may also have a different layout, a different number
of Europeans that if you understand this lesson well, it would be easy for you to find it.
And one thing you can notice here is that is not just an analog underpins its written analog in which
means analog input.
So by default, the analog pings on the original are set as input beings, which means that in your
code you would not have to call the pinboard function first.
You can just use directly the analog been to read values from an analog sensor.
Now, how does it work on the Andrina?
When you read data from an analog input pin, you will get an integer value between zero and one thousand
twenty three.
This number will be determined directly from the voltage applied to the pin.
So an analog sensor like you put on Showier, which is basically a valuable resistance, will simply
apply a different voltage on the other being from zero to five volt.
The Orange Bowl will read this voltage and translate it into an integer number.
So four zero volt you will get the value.
Zero or five volt you will get one thousand twenty three.
And let's say that the voltage is three volts.
So three volts is 60 percent of five volt, which means that you will reach the value.
Six hundred and fourteen.
Any other value between zero and five volt will give you a value between zero and one thousand twenty
three in your program.
You can directly use these range of integers, which will be easier to process than voltage numbers.
So that's how analog input beings work.
And now this is an important addition.
And it may seem weird, but you can't use the analog right function on an analog being.
The analog right function is used on only some digital pins which have a B.W. and functionality in order
to right an analog value to actually do so.
The choice of the name of the function from the developers of the original library was maybe not the
best choice for clarity.
Just remember that you can't use analog right on things.
You can only read analog values.
You can't write.