2. OBJETIVOS
• Trabajar con salidas digitales
• Desarrollar nuestro primer programa escrito
• Controlar LED RGB
• Trabajar con estructuras de control for
• Comprender la diferencia entre legibilidad y
funcionalidad
3. Ideas Previas:
• ¿Cómo funciona un semáforo?
• ¿Cuántos estados tiene?
• ¿Qué podemos añadirle usando sólo salidas
digitales?
INTRODUCCIÓN
4. • ARDUINO BASIC SHIELD
• SALIDAS DIGITALES
• ESQUEMA LED RGB
• COLORES RGB
• ESTRUCTURA FOR
• PROGRAMA MODIFICAR
INFORMACIÓN
12. Realizar un semáforo 10s verde, 2s amarillo, 5s rojo
• Completar el programa anterior
• Simplificar el código
• Añadir parpadeo de 0,2s a la luz amarilla
• Usar for para la repetición
• Añadir timbre, que puede sonar al unísono con la luz
amarilla parpadeante
• Reducir el tiempo de parpadeo en cada bucle
HACER
14.
Este
guía
se
distribuye
bajo
licencia
Reconocimiento-‐
ComparMrIgual
CreaMve
commons
4.0
(cc)
2014
José
Pujol
Pérez
Some
rights
reserved.
This
work
licensed
under
CreaMve
Commons
AXribuMon-‐ShareAlike
License.
To
view
a
copy
of
full
license,
see
hXp://creaMvecommons.org/licenses/by-‐sa/3.0/
or
write
to
CreaMve
Commons,
559
Nathan
AbboX
Way,
Stanford,
California
94305,
USA.
Some
of
the
figures
have
been
taken
from
the
Internet
Source,
and
author
and
licence
if
known,
is
specified.
For
those
images,
fair
use
applies.
licencia