Hi! Welcome to esp8266 tutorial from Robojax my name is Ahmad Shamshiri in this video I we're
going to learn how to use this ht16k33 four-digit 7 segment display with node mcu wamas d1mini
to display integer integer with leading zeros negative integer float value with decimal point
float with three decimal point float with negative value full float with one decimal point
and clock hexadecimal value and then dim it set the brightness at any level between 0 to 15 value
you can get the datasheet and other files related to this click by clicking
the link below the video in the description which will take you
to robojax.com/learn/Arduino let's get started with this
this module works with five volts I’ve reviewed the data sheet and full explanation of this in
separate video the link is below the video but for this video we can just say that this is 5 volts
and the next pen is the ground this is sda pen for I square c communication and the last one is scl
pen for I score c communication.
how to use this ht-16 k33 with esp32
this esp8266 NodeMCU the small one because we have this large one and a small one this is 4.5
the vn pin also give you 4.5 volts which we will test to show you that it will work
on this large one dependencies vv or vu that is the five volts I’ve connected the two wire here
and that's five volts on this type of d1 mini we have five volts here at this side the last
pin is five volts this will work also with NodeMCU esp8266 small version or if you have this larger
version uh just pay attention to vn for the small one as five volts and in this one then use this vv
or vu pin on this side for five volts and for ground use any of the ground here for sda and scl
d2 is sda and d1 is scl larger module d2 again is here sda and that one is scl so
sda scl so 5 volts ground sda scl now let me explain the code the
first thing you need to do is install the library go to tool manage libraries
wait for this screen to complete this bar graph type here ht16k33
and wait for this and as you can see ht 16k 33 by rob teller
and this is the one I’ve installed it you will see install button here just click and install
it will work with NodeMCU esp8266 esp32 and Arduino so this library works with everything
and this is the address for the library if you want to download it this line says include the
library and from the class of library we create a an object called segment and we pass the I
square c address and this is 0x70 that's hex value by default this is a value if you want
you can change it for example if you want to use two or three of these I have a separate example
the link is below the video you can change with give different address to each module
and start and stop this is the example for the code this is an array that is used for example
not needed this is we are initializing the serial monitor to display the text
if I click on tools serial monitor that number must match if you go at the bottom
on the right side select 115 200 then you will be able to display the text if you want
segment dot begin initializes the seven segment display this is setting the I square c
address this is turning the display on segment dot display on this is setting the number of digits
set digits and this is just printing the text this is running test six times test is the code that
runs every segment and different numbers will appear so if you wanted to be quick just make
it one and it will run one time and display off will turn it off because some of the segments that
have been turned on here we must turn them off give it here one second you can make
it very quick 100 millisecond and then turn the display on back and then we turn the column off
initially display column false if you want to display it set it to true, true with lowercase
and inside the loop we set the number of digits to one and then so all the digits are
turned off and then we when we put 64 it will turn it on for us so we give it five seconds to display
64 and then set the digit to 4 and now we set 64. now this 64 with this 64 the difference is
that you will see two digits on the left side when it is displayed because we set it to four
and this line says digit to one again we start from minus 74 give it five second and here when
you display float you say this float with a decimal value and one means one decimal place
so if you do not have more value if you say three then after five we will see two more so total
three decimal place will be displayed even if you don't have value and this is for the negative
value just put negative with a three decimal place this is a four digit with one decimal place
and then we turn it off keep it one second and then turn it on set the digits to two
and then minus one this is displaying display time this is for the time 18 the time it time
18 hours and 25 minutes and then display column and keep it on for three seconds then turn off
the column display column one display column zero and then here it says set digits we set it to 1
and this is a for loop that starts from -300 it goes up to 299 every time with a
increment of plus 7 starts from minus 300 it goes seven up until it reaches 299 and every
time whatever is this counter will be displayed on the screen give it hundred milliseconds so
the loop will go and then this displays the hex value when you say display hex you put
0 x with the hexadecimal value it will be the straight for 3 seconds for example we go from 15
decremented up to 0 and this is the hexadecimal value and also whatever is I from 0 to 15 when
you say brightness I this I can be from 0 to 15 so 0 is turned off from 1 to 15 or
different level of brightness which I’m going to demonstrate it and give it 500 millisecond
and here it says that brightness to 15 which is maximum so this is a full explanation of the code
I’ve uploaded the code let me demonstrate it and show you.
so I’m gonna reboot this by pressing this reset button here
it showed the test five times and then we set it to one decimal point and display 64. now
four decimal four digits because we have leading zeros again the same 64 and then one digit with
-74 and then one decimal point 33.5 and then three decimal point will be displayed like that and then
minus 12.6 here's three decimal point will not have an any effect and then one decimal point as
you can see and then we turn it off one second and then turn it on and then with two decimal point we
want to display with two digits and then we set it as a clock and after that this is just a counter
it goes from minus 300 to 300 and then this is hexadecimal value and then we go
displaying hexadecimal with the highest brightness we go up to zero
and then decimal the brightness is set to 15 for five seconds
and then one for five seconds you can see it it's very dim and then we set it to 10.
so as you can see in the test if I turn it off you will see this segments so you can turn on
and off any segment in any way you want and we have example for all of those with a library
I’m now working on writing code for to build internet clock for esp32 and NodeMCU d1 mini
this will be published the link is below the video in the description in this video I’m going to show
you how we can use the d1 mini esp8266 wi-fi module with the lcd screen we're going to use
the lcd 1602 or lcd 204 which are using only four wires to connect it to the device in this tutorial
we are going to learn how we can use the nodemcu or d1 mini esp8266 to control stepper motor 28 by
j48 over the wi-fi and I touch it counterclockwise the motor rotates in counter-clockwise
and I can stop it I can go to clockwise now or without stopping I can jump to the other direction
from this module let's control the motor as you can see it is responding very well
in this tutorial I’m going to show you how we can control a dc motor using l298a module with
node mcu d1 mini esp8266 over the wi-fi we will going to have two buttons to increase the speed
the motor will speed up or we will slow it down from the mobile phone
very responsive
100 percent