miércoles, 21 de enero de 2026

Practica 2: led intermitente

 En esta practica hemos conectado el puerto 10 y 13, para que los leds se enciendan y apaguen intermitentemente. Este es el programa que hemos realizado:

void setup() {

  // initialize digital pin LED_BUILTIN as an output.

  pinMode(13, OUTPUT);

  pinMode(10, OUTPUT);

  }

// the loop function runs over and over again forever

void loop() {

  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)

  digitalWrite(10, LOW);    // turn the LED off by making the voltage LOW

  delay(500);                       // wait for a second

  digitalWrite(13, LOW);   // turn the LED on (HIGH is the voltage level)

  digitalWrite(10, HIGH);    // turn the LED off by making the voltage LOW

   delay(500);   

}

A continuación adjunto una foto y video de prueba:






No hay comentarios:

Publicar un comentario

Práctica 8: leds alternos con pulsador

 En esta práctica hemos encendido un led y apagado otro a través de un pulsador. Un led estaba encendido al principio y otro apagado. Al pul...