0:00
welcome to the third video of the esp32
0:04
we have already created an access point
0:08
now we will add buttons to this web
0:10
server along with the different uris to
0:15
let's look for the button code
0:40
here we have two buttons so i am
0:43
deleting the blue button
0:51
let's add some headings and texts here
1:09
let's change this button text
1:20
the click doesn't work right now so we
1:22
have to add the click to it
1:28
let me try to check with google.com
1:35
so it did try to connect and that's
1:39
here we will enter the uri which this
1:42
button is going to refer
1:44
so if we click the button it should take
1:49
here the led state is off and if we
1:51
click the button it should go to the led
1:55
there we will write the code to turn on
1:58
so that's it for this button
2:01
let's copy the whole thing
2:05
and we will paste it in the user ctx
2:11
make sure you paste it inside the
2:15
at the end of every line we will put the
2:19
this is to indicate that the statement
2:21
continues in the next line
2:30
now before the double quotes put the
2:34
this is how the quotations are put in a
2:45
all right now let's build it to check
2:53
this was the uri and handler for the led
2:56
we also need to create one for led on
3:00
we will copy the same thing and make
3:13
we need to make some changes in the
3:17
we will change the button text and its
3:21
let's change its color also
3:26
the led state should be on now
3:36
instead of copying this whole thing i
3:38
will simply make those changes here also
3:45
so that's all for the button part
3:49
now we need to register this uri just
3:52
like we did the other one
4:01
let's build and flash it on our board
4:15
now connect to the access point and
4:17
access the web server
4:33
so the led is on and the button is
4:35
displaying the off option
4:37
now the led state is off and the button
4:40
is displaying to turn it on
4:42
you can check the logs also
4:47
right now the led is on and if we click
4:50
the off button here you can see the led
4:56
this is it for this part
4:58
we added the button code to the web
5:00
server along with the new uri to handle
5:04
the next video will add the led to this
5:07
project and we can finally see the led