Entradas

Mostrando entradas de septiembre, 2019

Clase II

Miércoles 18 de Septiembre de 2019 El día de hoy vamos a trabajar con el bluetooth, para configurar su nombre y el pin Bluetooth, vamos a trabajar con un bluetooth de 4 patitas HC-06 Conexión entre el Bluetooth y el arduino: VCC-5v GND-GND TXD-10 Rxd-11 CÓDIGOS: #include // Incluimos la librería SoftwareSerial SoftwareSerial BT(10,11); // Definimos los pines RX y TX del Arduino conectados al Bluetooth void setup() { BT.begin(9600); // Inicializamos el puerto serie BT que hemos creado Serial.begin(9600); // Inicializamos el puerto serie } void loop() { if(BT.available()) // Si llega un dato por el puerto BT se envía al monitor serial { Serial.write(BT.read()); } if(Serial.available()) // Si llega un dato por el monitor serial se envía al puerto BT { BT.write(Serial.read()); } } Al momento de guardar y subir los códigos aparecerá na ventana en la parte superior izquierda donde se pondrá en letras mayúsculas ¨AT¨ Después ejecute el...
Imagen
Monitoreando valores

PRIMER PARCIAL- SEGUNDO QUIMESTRE

Miercoles 11 de Septiembre de 2019 Sensor DHT11  Los siguientes códigos sirven para medir la temperatura y humedad Serial.print("Humidity: ");    Serial.print(h);    Serial.print(" %\t");    Serial.print("Temperature: ");    Serial.print(t);    Serial.print(" *C ");      if(t>26)    (     digitalWrite(5,HIGH);// encender motor    )    else    (     digitalWrite(5, LOW);// apagar motor    )      ) DHT11 // Connect pin 2 of the sensor to whatever your DHTPIN is // Connect pin 4 (on the right) of the sensor to GROUND // Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor int DHTPin = 5;     // what digital pin we're connected to DHT dht(DHTPin, DHTTYPE); void setup() {    Serial.begin(9600);    Serial.println("Moniteroando valores");  ...