Go Down

Topic: Error compilando para la tarjeta Arduino/Genuino Uno (Read 55 times) previous topic - next topic

Hanzel326

Code: [Select]

#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include <DS3231.h>
#include "DHT.h"

DS3231 rtc(SDA, SCL);


#define DHTPIN 6
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);

LiquidCrystal_I2C lcd(0x27,20,4);

void setup() {
  // put your setup code here, to run once:
  rtc.begin();
dht.begin();
lcd.begin(20,4);
pinMode(6,INPUT);

  rtc.setDOW(FRIDAY);     // Set Day-of-Week to SUNDAY
  rtc.setTime(15, 21, 00);     // Set the time to 12:00:00 (24hr format)
  rtc.setDate(04, 02, 2020);   // Set the date to January 1st, 2014
 
  lcd.init();
  lcd.backlight();
  lcd.clear();
 
  lcd.setCursor(0,2);
  lcd.print("ELEC. DE POTENCIA");
}

void loop() {
  // put your main code here, to run repeatedly:
lcd.setCursor(0, 0);
lcd.print("HORA:  ");
lcd.print(rtc.getTimeStr());
 
 

lcd.setCursor(0, 1);
lcd.print("FECHA: ");
lcd.print(rtc.getDateStr());
   
float temperatura= dht.readTemperature();
float humedad= dht.readHumidity();
lcd.setCursor(2,3);
lcd.print(temperatura,1);
lcd.setCursor(0,3);
lcd.print("T=");
lcd.setCursor(6,3);
lcd.print((char)223);
lcd.setCursor(7,3);
lcd.print("C");
lcd.setCursor(9,3);
lcd.print("HR=");
lcd.print(humedad,1);
lcd.setCursor(16,3);
lcd.print("%");


}

surbyte

Oh vaya, para que mostrar cual es el error?
Explicar un poco no creo que te de mucho trabajo además!!

Go Up