01 - Digital - IO - LQ
01 - Digital - IO - LQ
01 - Digital - IO - LQ
Digital Input/Output
.DIEM
INTERNET OF THINGS
• Most of the pins on the board are General Purpose Input Output
(GPIO) pins
I/O pins on • i.e. they do not have a pre-assigned function, but can be used
for different purposes, if suitably configured
• While a pin usually have different possible functions, you cannot
theBoard have all the functions on all the pins
• You need a map of the pins of your board to know what you
can do with each pin
1
25/03/23
2
25/03/23
DigitalOutputs
• Digital output pins translate a logical value (1 or 0) to one of
two voltage levels: 0V for 0, and 3.3V for 1
• This voltage level can be used as an input for another device
3
25/03/23
4
25/03/23
Output pin
10
5
25/03/23
Output pin
11
Output pin
12
6
25/03/23
VHIGH VF
13
14
7
25/03/23
R
By the way, if we do not know VF,
we can connect the LED to a
Voltage source
power source using a “safe”
resistor (e.g. 1kΩ), and measure
VF with our multimeter
15
16
8
25/03/23
Hands on
session
Handling digital outputs on ESP32
17
18
9
25/03/23
19
… is it right?
20
10
25/03/23
21
22
11
25/03/23
23
24
12
25/03/23
25
Since the need to use pull-up or pull-down resistors is very common, the MCU
has internal, built-in resistors that you can activate when you set the working
mode of the pin
internal
internal
26
13
25/03/23
27
A physicalpush-button
• The most commonly available push-buttons have actually 4
pins
• A is always connected to D, and B is always connected to C
• When the button is pressed, all four pins are connected together
28
14
25/03/23
Hands on
session
Handling digital inputs on ESP32
29
Introducing interrupts
ESP32 provides up to 32 interrupt slots for each core. Each
interrupt has a certain priority level and can be classified into
two types.
30
15
25/03/23
31
32
16
25/03/23
Hands on
session
33
34
17