/*
Programma:LCD_shield-KY-015.ino
Collaudo KY-015 Temperature and humidity sensor module
Su Arduino sono utilizzati i seguenti pin
Pin GND -> Pin GND modulo
Pin +5V -> Pin VCC modulo
Pin 2 -> Pin Data modulo
Ultima modifica il 25/9/2016
Applicazione by Adriano Gandolfo
Sito https://www.adrirobot.it
Blog http://it.emcelettronica.com/author/adrirobot
Pagina Facebook https://www.facebook.com/Adrirobot-318949048122955
Istagram https://www.instagram.com/adrirobot/
This example code is in the public domain.
*/
#define CUSTOM_SETTINGS
#define INCLUDE_LCD_SHIELD
/* Include 1Sheeld library. */
#include <OneSheeld.h>
#include <dht11.h>
dht11 DHT11;
#define DHT11PIN 2
void setup()
{
/* Inizializzazione comunicazione */
OneSheeld.begin();
LCD.begin();
delay(1000); // wait for sensor initialization
}
void loop()
{
uint8_t chk = DHT11.read(DHT11PIN);
LCD.setCursor(0, 0);
LCD.print("Umidita' :");
LCD.print((float)DHT11.humidity, 1);
LCD.print(" %");
LCD.setCursor(1, 0);
LCD.print("Temperat.:");
LCD.print((float)DHT11.temperature, 1);
LCD.print(" C");
/* Attesa per la successiva misura. */
OneSheeld.delay(1000);
} |