hi welcome to another unit tutorial from Robojax. in this video I'm going to show you how you can
use two or more LCD 16:02 display with I2C modules on the same Arduino to display data
you can get the code for this by clicking at the link of the description below which will take you
to Robojax.com/learn/arduino let's get started with this
many are doing application you need to connect two or more of these display to
display different values or maybe extend the wire and place them at different locations to
DIF to display different parameters and for that reason this video will explain that I've separate
video explaining how the addressing issue of this I squared C module is resolved our separate video
explaining this fully wiring so in this video I'm not gonna focus on those because I will
provide you the line you can wash them this is just concerned on how to connect these two and
also have written custom function to display the text decimal float values and strength easily
let me now explain the wiring the five vaults have been connected here this orange is five
volts so we have all this line as five volts and yellow is a ground ground is connected
in here for those of you who don't know that these lines are connected up to here and now
provides five volts and all of this line up to here as five volts and then from pile up an a4
and a5 which the first one if FDA and the other if Cl I've connected it to this pin
this blue and green and blue and from here you can see there's five volts 5 volts he
is connected to VCC the second pin and then the ground this gray is connected to the last
one which is ground and then from here blue is aligned with this blue which goes to an a4 and
the green is aligned with a green which goes to a 5 on Arduino and the last one
using Arduino Uno and then then SCL fa5 and SDA sa4 and Arduino
mega SDS 20 and then a CLS 21 and Leonardo and all of those
and here is the addressing I am going to solder this part and there is another one
that have already done it and it was very hard for me to solder it
what I did was I put this tiny wire and I soldered it now I'm going to clip this
right now this has been soldered - so a zero is now closed and the
address that I've selected for for the if you don't saw that anything for the
first one I'm going to leave it as zero zero zero all of them not closed or not
soldered so it will be twenty seven and then I saw there's only this one zero
in my case for the first module this is the least significant digit in terms of binary reading and
this is the most significant digit usually it's supposed to be the other way is zero should be
this way but I found it like this on the module so I'm present presenting it like this the first
module is not so that not so that means zero zero and when it's ordered it's represented as 1 so a
0 is represented for the my second module as one which has been soldered and you can continue if
you have the third module you can go for a1 solder it and then if you have the fourth one like this
so this table is here just follow it these are just binary this is 0 and this is up to 7 so 0
plus seven eight so we have eight a different combination and it's possible to get more
now let me explain the code and also demonstrate in here what you will see the first line starts
with wire.h this is part of our doing idea when you run this program it's part of it you don't
have to do anything this liquidCrystal_i2c.h is a library that will provide you the link you have to
download and include it in your library if you don't know how one way would be click on sketch
library at web library and then point towards the zip file let's say this is you is be there
for whatever it will be liquid crystal does zip click and open and it will be included from this
point we need to define for first display this is what we do LCD 1 and LCD 2 if you have more
than two then just copy this and go next line make it 3 4 and I believe up to 8 you can have and this
will take three parameters here and just take these three arguments these dozen first one is
the address I square C address the second one is number of characters the third one this is number
of rows so we have to do of 16 character for this one you need to find the address of this module
this I squared C module has an address you need to find that for that I will provide you with scanner
this is the I squared T scanner I've written it has been written online and let me upload it
and once the front it will tell you data so I have to item - 0 - 6 and the other
than a 0 X 3 to the 0 X min hex and 2060 the 26 a value of hexadecimal so it just
constantly reads it every few seconds and you will give you'll get the address and
I'm using these two addresses for my two devices to find out which devices
which you can just disconnect for example this is the last one I'm disconnecting it
and now you will see that we will have only one so this is 26 0 X 26 and this one was 3f
this is the decimal places for float value for example 0.84 so if you want to decimal please just
put two if you want three we'll make it three this position is five total numbers for this so this is
one two with a decimal is three four five so tell this you have to change it accordingly because I
have written a code that this can display any value integer string so you can easily send any
value and it will be displayed because there are some issue for that and this is my solution inside
the setup we have to use the begin to initialize the screen this is LCD one that begin and LCD two
two dot begin for both of those and also we have to turn on the backlight within city one LCD to
this is I squared this is the serial monitor initialization that here it has this 9600 baud
it must match this number and after that this is just a text that shows on this screen let me show
you play one in here and then the same way we have displayed two after that this is for the serial
monitor and this is also three seconds delay so the person can read initial information and
recognize which displays which and after that we will clear the screen with using LCD one clear and
then see the two that clear so we have to clear both screens so new information can be displayed
uh none side the loop defined these values first age 31 and then number of days is calculated by
H times 365 this is number of days this person is living and it's being displayed on as you can see
here the age and days so I've written here this code LCD display to make it very easy and it takes
all these arguments five arguments here or for the one here it's displays one so that's referring to
the display and there is referring to the role and this is referring to the row 1 so that rule
0 this is Row 1 and then we say age and then the age that text is displayed here because we are
in row 0 and then end to a string I've written this function which I'm going to explain next
it takes this age and converts it to a string and the results will be displayed here as 31 and then
this text inside you see double quotation for the age you have to put double quotation because it's
a text and that's for the first row and then for for the second row which is row 1 0 that's row 1
then we say Dave's and then it this is the value 11,000 315 and then the text days now this is a CD
to display this is now number 2 same thing this is goes for the display to both of them this is
for row 0 Rho 1 and Rho 0 we posted a text weight and then this time we use floats a string because
the weight is float so we have to convert it to a string to display it here and it shows the weight
as 4 point 8 4 and then we display the kilogram and on the second line we display the text this
text voltage and then we get the voltage 22 22 point 1 here we convert that float into volt value
of text and then we print the V attached to it pay attention here for kilogram we put space so that's
the space and here I didn't put a space and V is attached and the reason for converting everything
to Texas so you can display anything you want and the value will have even either a text if you have
a text just put the text here inside the quotation it will be a text and if you have a float just use
float to string and you have integers just say integer to string and then inside this you can
put a number here I put that variable and this is just a text that displays it and here for
test purpose if you want to eliminate it you just eliminate those values that are displayed here and
we have 50 seconds delay milliseconds delay and it continues like that now let me explain this
and I have to display explain this as well to float so this value that you pass is here LCD
to LCD display it gets that value as 1 we call it here and display and then row number and then the
text and also text text you see all these three other parameter source text except these two or
integer and they must be integers and then it will display the code for us how it does is that this
is for display 1 and we say F death is equal D is or display equal equal we are comparing it if it's
equal 1 we do all this you don't have to worry about it this all works simple and explanatory
and for display - we just copy and paste this here we have display 2 and the only difference is that
this sales display 1 display one and Hills LCD - LCD - and if you have the third one just copy this
paste it below and make this 3 and then everything else to the to change into 3 Alice you have 4 5
after 8 you can do the same thing and here we have clear row I have written a function below clear
road every time you display a text here you must clear the previous value and this the job of this
one is to clear the row and here the same thing FD is equal this D is display which display 1 to
clear and which row and here we say F display is equal 1 clear display 1 LCD 1 LCD one set cursor
and then print blank and for display to also we say LCD 2 and then copy this and paste it inside
in here for the 3 & 4 5 & to it here integers the string this just converts takes this a as an
integer and converses to string and this gets flow to a string yes code which faceted all of this
for you so you can just use this one and easily display the text thank you for watching this was
how to use two or more and CD of sixteen or two using Arduino if you like this with you and learn
something from it please sum up please put your comment or question or the comment section below I
will try to answer and reply and please subscribe so you can grab this of my upcoming videos
you