0:00
welcome to the fourth video of the esp
0:04
until now we have created an access
0:06
point and then a web server using that
0:10
we have also added the html button codes
0:15
now we will add the led to it
0:17
let's include the gp io drivers to the
0:31
in my esp32 room kit the onboard led is
0:49
now first of all we will configure this
0:52
pin as the output pin
0:54
let's create a function to configure
1:03
we will reset the pin
1:10
and then we will set the direction as
1:24
now call the configure led function
1:26
inside the main function
1:36
inside the led on handler we will turn
1:38
the led on and to do that we will call
1:41
the gpio set level function
1:48
similarly inside the led off handler we
1:51
will turn the led off this is it now
1:55
build the code and flash it to the board
2:09
so the led is off right now you can
2:12
check the top right corner to see the
2:18
when we click the button the led turns
2:36
so the web server is working all right
2:39
even though everything is fine still if
2:41
we go to the main page it shows error
2:45
this is because we are not handling the
2:59
so let's add another uri and i am
3:02
calling it root this will handle the
3:07
it will still call the led off handler
3:10
so if we go to the home page it will
3:14
we need to register this uri also
3:27
all right let's build and flash it
3:34
now if i try to go to the main page it
3:37
is showing the led is off just like we
3:44
the rest of it is also working all right
3:48
let me try to connect using my phone
3:51
first i need to connect to the access
3:56
and now i can control the led
4:20
notice here when the phone was connected
4:23
it allocated the ip4.3
4:26
if you recall in the first video we did
4:29
set up that four stations can connect to
4:33
this is it for this video
4:35
i hope you understood the basic web
4:37
server using this esp32 controller
4:41
i will work on some other protocols and
4:44
release the video when they are ready
4:46
you can download the code from the link
4:50
leave comments in case of any doubt
4:53
keep watching and have a nice day ahead