Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ********** Arduino **********
- * Laboratorio 08: Temperatura y humedad con DHT11 y Luz con (LdR, CdS) con una interfaz gráfica
- * Descripcion:
- * Mostrar en una interfaz de Processing la temperatura y humedad (DTH11),
- * y el nivel de iluminación capturado con una fotoresistencia (LdR, CdS) medidas a través de un Arduino.
- */
- #include <dht.h>
- #define dht_apin A0
- dht DHT;
- int pinLDR = A1;
- int valorLDR = 0;
- void setup(){
- Serial.begin(9600);
- }
- void loop(){
- valorLDR= analogRead(A1);
- DHT.read11(dht_apin);
- Serial.print(DHT.temperature);
- Serial.print(".");
- Serial.print(DHT.humidity);
- Serial.print(".");
- Serial.println(valorLDR);
- delay(1000);
- }
Advertisement
Add Comment
Please, Sign In to add comment