Activa JavaScript para disfrutar de los vídeos de la Mediateca.
Arduino: buzzer (native speaker) - Contenido educativo
Ajuste de pantallaEl ajuste de pantalla se aprecia al ver el vídeo en pantalla completa. Elige la presentación que más te guste:
Hello. In this video tutorial we're
00:00:00
going to learn how to use a
00:00:06
buzzer a buzzer or a beeper is
00:00:07
a device that produces sound the first
00:00:10
thing we need to know is that
00:00:13
there is a buzzer here in the
00:00:14
library of components in spanish it's called
00:00:16
"Piezo"
00:00:20
and we're going to click and drag
00:00:22
this to the protoboard so we're
00:00:23
going to connect the beeper or buzzer
00:00:25
to the arduino board and one of
00:00:27
the connectors is going to be connected
00:00:29
to the ground and the other one
00:00:32
to whichever digital pen we want
00:00:35
so for instance here it has been
00:00:38
connected to pin twelve
00:00:41
now to program it let's have a
00:00:47
look at the code
00:00:49
so this is the simplest way to
00:00:56
program the buzzer we have used one
00:00:58
of the blue output blocks from this
00:01:01
set here
00:01:03
and we use the one for "pasador"
00:01:05
word meaning connector
00:01:07
and we've connected it to number twelve
00:01:14
and "tono" is the tone or frequency
00:01:17
and it's going to be fifty hurts
00:01:20
and it's going to make sound for
00:01:23
half of a second and then we
00:01:26
will wait for one second
00:01:27
before we start again
00:01:30
so that's where we have to wait
00:01:34
but be careful because sound for half
00:01:36
of a second and waiting for one
00:01:38
more second does not mean that the
00:01:40
whole program will last one and a
00:01:42
half seconds because the moment that we
00:01:44
start the sound we start the waiting
00:01:49
to see
00:01:51
that means that while we're waiting there
00:01:52
is also sound continuing so here it
00:01:54
means that we're going to be waiting
00:01:57
for one second but during this second
00:01:59
half of it will have sound
00:02:02
so here we have a square wave
00:02:05
half of the second is going to
00:02:09
be sound and the second half will
00:02:11
be no sound because we're waiting for
00:02:13
that one second to finishing the
00:02:16
program
00:02:18
okay so if we start the simulation
00:02:27
now let's change the frequency from fifty
00:02:39
to one hundred hertz
00:02:41
and try again it sounds different
00:02:44
because the frequency is higher
00:02:49
it sounds different because the frequency is
00:02:53
high now let's try this instead of
00:02:55
producing sound for half of a second
00:02:57
let's do it for zero point seven
00:03:00
seconds
00:03:02
and that means that seventy percent of
00:03:04
the time there will be sound during
00:03:06
the seventy percent of the time we
00:03:08
are waiting
00:03:10
so let's produce this sound now again
00:03:14
can you hear
00:03:22
can you hear that there's a period
00:03:24
of time while there's no sound and
00:03:25
it's shorter than before so there's sound
00:03:27
four point seven seconds and then no
00:03:29
sound for point three seconds this is
00:03:31
the simplest way of programming a buzzer
00:03:34
but we're going to make the program
00:03:36
a little more complicated we are going
00:03:37
to program it using a
00:03:40
different sequence
00:03:43
with a loop
00:03:44
okay so now you can see this
00:03:51
code this word here means loop this
00:03:53
is a program we have from before
00:03:57
the same one and we are going
00:03:59
to put it inside of the loop
00:04:00
so there are two drop-down possibilities counting
00:04:03
upward or downward so we will either
00:04:06
move up or down
00:04:10
so the first thing that we need
00:04:12
is a variable
00:04:13
this
00:04:19
this purple ok the name for this
00:04:21
variable is tono you can name it
00:04:24
frequency or tone whatever you want so
00:04:25
with this variable we are controlling the
00:04:28
frequency we are going to sweep frequencies
00:04:31
from ten hertz to one hundred and
00:04:34
thirty hertz and each time it jumps
00:04:36
by twenty units
00:04:39
is moving upwards
00:04:41
okay I will show you an example
00:04:44
it's first frequency and then hurts
00:04:46
to the second one is ten plus
00:04:51
twenty so thirty thirty plus twenty is
00:04:52
fifty then fifty plus twenty seventy then
00:04:55
ninety one hundred ten and one hundred
00:04:59
thirty is the last one so each
00:05:01
time we jump we're adding twenty units
00:05:03
according to the program and this is
00:05:06
the meaning of twenty here and
00:05:08
we're starting with ten and ending with
00:05:10
one thirty
00:05:12
here we have the variable we are
00:05:15
going to use to store the numbers
00:05:17
and tier having upwards means that the
00:05:20
numbers will get higher or count up
00:05:22
we could also choose to move downwards
00:05:25
but in that way we will start
00:05:27
with one thirty and finish at ten
00:05:29
okay
00:05:32
so i think now you can see
00:05:34
that we have a lot of possibilities
00:05:35
in this loop it's the same set
00:05:38
from the previous example that is now
00:05:40
inside the loop so listen to the
00:05:42
simulation
00:05:44
and you will be able to hear
00:05:47
the frequencies get higher until it loops
00:05:49
and starts all over again
00:05:52
okay let's start a simulation
00:05:58
you are how it's going up getting
00:06:10
higher
00:06:12
frequency is getting higher so this second
00:06:14
program is what you are going to
00:06:16
reproduce as well as answer two more
00:06:17
questions below
00:06:19
good luck
00:06:23
- Idioma/s:
- Autor/es:
- David Gonzalez Arroyo, Alyssa Fantel
- Subido por:
- David G.
- Licencia:
- Reconocimiento - No comercial - Compartir igual
- Visualizaciones:
- 60
- Fecha:
- 24 de febrero de 2022 - 0:05
- Visibilidad:
- Público
- Centro:
- IES MARIE CURIE Loeches
- Duración:
- 06′ 25″
- Relación de aspecto:
- 1.78:1
- Resolución:
- 1920x1080 píxeles
- Tamaño:
- 74.18 MBytes