Está en la página 1de 2

Nº PRÁCTICA: PRÁCTICA 30

TÍTULO: ENCENDER LUZ POR BLUETOOTH

FECHA:
CURSO: 1 BACH D
14/02/23

NOMBRE Y APELLIDOS: FERNANDO CALVO

NOMBRE Y APELLIDOS: VÍCTOR VILA

PRÁCTICAS ARDUINO:

1- ¿Qué se pretende conseguir con esta práctica?

Encender o apagar un led por bluetooth.

2- Materiales empleados:

● Led
● Cables
● Placa base
● Placa Uno
● Dispositivo bluetooth
3- Programación para Arduino.

#include <SoftwareSerial.h>
SoftwareSerial BT(0,1);
int led13 = 13;
int estado = 0;
void setup()
{
Serial.begin (9600);
BT.begin(9600):
pinMode (led13, OUTPUT);
}
void loop()
{
estado = BT.read();
if (estado = '0')
{
digitallirite(led13, LOW);
}
if (estado = '1')
{
digitallirite(led13, HIGH);
}
if (estado 2")
{
digitalWrite(led13, HIGH);
delay (300);
digitalWrite (led13, LOW);
delay (300);
Nº PRÁCTICA: PRÁCTICA 30

TÍTULO: ENCENDER LUZ POR BLUETOOTH

FECHA:
CURSO: 1 BACH D
14/02/23

NOMBRE Y APELLIDOS: FERNANDO CALVO

NOMBRE Y APELLIDOS: VÍCTOR VILA

digitalWrite(led13, HIGH);
delay (300);
digitalWrite (led13, LOW);
delay (300);
digitalWrite(led13, HIGH);
delay (300);
digitalwrite(led13, LOW)
delay (300);
}
if (estado==’3’)
{
digitalwrite(led13, HIGH):
delay (300);
digitalwrite(led3, LOW);
delay (300);
digitalwrite(led13, HIGH):
delay (900);
digitalwrite(led3, LOW);
delay (900);
}
4- Foto del montaje final.

También podría gustarte