Buenos días compañeros.
Tengo un problemilla, me he currado un código en el que tengo que usar un reloj (RTC) y resulta que al compilar el programa me dice lo siguiente:
Completo_1_Adaptacion_5_Seguidores.ino:163:50: error: RTClib.h: No such file or directory
Completo[/b]_1_Adaptacion_5_Seguidores:171: error: 'RTC_DS1307' does not name a type
Completo_1_Adaptacion_5_Seguidores.ino: In function 'void setup()':
Completo_1_Adaptacion_5_Seguidores:243: error: 'RTC' was not declared in this scope
Completo_1_Adaptacion_5_Seguidores.ino: In function 'void loop()':
Completo_1_Adaptacion_5_Seguidores:314: error: 'DateTime' was not declared in this scope
Completo_1_Adaptacion_5_Seguidores:314: error: expected ;' before 'now' Completo_1_Adaptacion_5_Seguidores:451: error: 'now' was not declared in this scope Completo_1_Adaptacion_5_Seguidores:524: error: 'RTC' was not declared in this scope Completo_1_Adaptacion_5_Seguidores.ino: In function 'int CicloComunicacion()': Completo_1_Adaptacion_5_Seguidores:541: error: 'DateTime' was not declared in this scope Completo_1_Adaptacion_5_Seguidores:541: error: expected
;' before 'now'
Completo_1_Adaptacion_5_Seguidores:591: error: 'now' was not declared in this scope
Completo_1_Adaptacion_5_Seguidores:599: error: 'now' was not declared in this scope
Completo_1_Adaptacion_5_Seguidores:607: error: 'now' was not declared in this scope
Completo_1_Adaptacion_5_Seguidores:615: error: 'now' was not declared in this scope
Completo_1_Adaptacion_5_Seguidores:623: error: 'now' was not declared in this scope
Completo_1_Adaptacion_5_Seguidores.ino: In function 'long int CalculoSegundos()':
Completo_1_Adaptacion_5_Seguidores:800: error: 'DateTime' was not declared in this scope
Completo_1_Adaptacion_5_Seguidores:800: error: expected ;' before 'now' Completo_1_Adaptacion_5_Seguidores:801: error: 'now' was not declared in this scope Completo_1_Adaptacion_5_Seguidores.ino: In function 'int CalculoDias()': Completo_1_Adaptacion_5_Seguidores:816: error: 'DateTime' was not declared in this scope Completo_1_Adaptacion_5_Seguidores:816: error: expected
;' before 'now'
Completo_1_Adaptacion_5_Seguidores:818: error: 'now' was not declared in this scope
Completo_1_Adaptacion_5_Seguidores.ino: In function 'int Calcula20Segundos(int)':
Completo_1_Adaptacion_5_Seguidores:1125: error: expected primary-expression before '>=' token
Completo_1_Adaptacion_5_Seguidores:1125: error: expected `;' before ')' token[/b]
El problema por tanto lo marca en la siguiente sentencia: RTC_DS1307 RTC; // Crea el objeto RTC
Pero el caso es que parece ser que no encuentra la librería RTC y yo lo he declarado como viene en los ejemplos, es decir, de la siguiente forma:
#include <SPI.h>
#include <Ethernet.h>
#include <Wire.h> // Incluye la libreria Wire
#include "RTClib.h" // Incluye la libreria RTClib
#include <math.h>
byte mac[] = { 0x90, 0xA2, 0xDA, 0x0D, 0xB7, 0xC7 };//mac de Arduino Ethernet
IPAddress ip(192,168,0, 5);// donde quieres situar al arduino
int serverPort=60;
RTC_DS1307 RTC; // Crea el objeto RTC
También he probado a ponerlo como #include <RTClib.h> pero da error también. ¿Alguien pude decirme como se corrige eso? Muchas gracias.