Download - Introducción a Arduino (II)
![Page 2: Introducción a Arduino (II)](https://reader033.vdocumento.com/reader033/viewer/2022050817/557d5495d8b42ae3298b5306/html5/thumbnails/2.jpg)
INTRODUCCIÓN A ARDUINO
• Lenguaje.
• Esquema básico, variables, funciones, Serial.
• Estructuras de control.
• Pines
• Digitales.
• Analógicos.
![Page 3: Introducción a Arduino (II)](https://reader033.vdocumento.com/reader033/viewer/2022050817/557d5495d8b42ae3298b5306/html5/thumbnails/3.jpg)
ENTORNO DE PROGRAMACIÓN (IDE)
Barra de herramientas
Editor de código
Ventana de estado
![Page 4: Introducción a Arduino (II)](https://reader033.vdocumento.com/reader033/viewer/2022050817/557d5495d8b42ae3298b5306/html5/thumbnails/4.jpg)
ESQUEMA BÁSICO
![Page 5: Introducción a Arduino (II)](https://reader033.vdocumento.com/reader033/viewer/2022050817/557d5495d8b42ae3298b5306/html5/thumbnails/5.jpg)
ESTRUCTURAS DE CONTROL: IF/ELSE
int i = HIGH; !if (i == HIGH) { // Se cumple Serial.println(“Activado”); } else { // No se cumple Serial.println(“Desactivado”); }
![Page 6: Introducción a Arduino (II)](https://reader033.vdocumento.com/reader033/viewer/2022050817/557d5495d8b42ae3298b5306/html5/thumbnails/6.jpg)
ESTRUCTURAS DE CONTROL: FOR
/* Repetir cien veces */ int c; !for (c = 0; c < 100; c = c + 1) { // Instrucciones Serial.println(c); }
![Page 7: Introducción a Arduino (II)](https://reader033.vdocumento.com/reader033/viewer/2022050817/557d5495d8b42ae3298b5306/html5/thumbnails/7.jpg)
PINES
![Page 8: Introducción a Arduino (II)](https://reader033.vdocumento.com/reader033/viewer/2022050817/557d5495d8b42ae3298b5306/html5/thumbnails/8.jpg)
PINES DIGITALES
digitalWrite()
digitalRead()
![Page 9: Introducción a Arduino (II)](https://reader033.vdocumento.com/reader033/viewer/2022050817/557d5495d8b42ae3298b5306/html5/thumbnails/9.jpg)
PINES ANALÓGICOS
analogRead()
![Page 10: Introducción a Arduino (II)](https://reader033.vdocumento.com/reader033/viewer/2022050817/557d5495d8b42ae3298b5306/html5/thumbnails/10.jpg)
PINES DIGITALES
ESCRIBIR pinMode(pin, OUTPUT); digitalWrite(pin, HIGH|LOW);
LEER pinMode(pin, INPUT); int valor = digitalRead(pin);
VALORES LOW/HIGH
0/1
![Page 11: Introducción a Arduino (II)](https://reader033.vdocumento.com/reader033/viewer/2022050817/557d5495d8b42ae3298b5306/html5/thumbnails/11.jpg)
PINES ANALÓGICOS
LEER int volt = analogRead(pin);
VALORES 0..1023