RTC_DS1307 does not name a type
G.sousou
Messages postés
3
Date d'inscription
Statut
Membre
Dernière intervention
-
G.sousou Messages postés 3 Date d'inscription Statut Membre Dernière intervention -
G.sousou Messages postés 3 Date d'inscription Statut Membre Dernière intervention -
bonjour , j'ai fait ce code en arduino pour afficher la date et l'heure dans un afficheur lcd a partir du ds1307, lors de compilation un message d'erreur m'apparait :'( malgres que j'ai installer le RTClib dans la bibliotheque:
#include <Wire.h>
#include “RTClib.h”
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
RTC_DS1307 RTC;
void setup () {
Serial.begin(9600);
Wire.begin();
RTC.begin();
lcd.begin(20, 4);
pinMode(8,OUTPUT);
if (! RTC.isrunning()) {
//Serial.println(“RTC is NOT running!”);
// following line sets the RTC to the date & time this sketch was compiled
RTC.adjust(DateTime(__DATE__, __TIME__));
}
}
void loop () {
DateTime now = RTC.now();
lcd.setCursor(0, 0);
lcd.print(now.day(), DEC);
lcd.print("/");
lcd.print(now.month(), DEC);
lcd.print("/");
lcd.print(now.year(), DEC);
lcd.print(" ");
lcd.setCursor(0, 1);
if (now.hour()<10)
lcd.print("0");
lcd.print(now.hour(), DEC);
lcd.print(",");
if (now.minute()<10)
lcd.print("0");
lcd.print(now.minute(), DEC);
lcd.print(":");
if (now.second()<10)
lcd.print("0");
lcd.print(now.second(), DEC);
delay(1000);
}
---
MERCI DE ME PROPOSER VOS SOLUTIONS !!!
#include <Wire.h>
#include “RTClib.h”
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
RTC_DS1307 RTC;
void setup () {
Serial.begin(9600);
Wire.begin();
RTC.begin();
lcd.begin(20, 4);
pinMode(8,OUTPUT);
if (! RTC.isrunning()) {
//Serial.println(“RTC is NOT running!”);
// following line sets the RTC to the date & time this sketch was compiled
RTC.adjust(DateTime(__DATE__, __TIME__));
}
}
void loop () {
DateTime now = RTC.now();
lcd.setCursor(0, 0);
lcd.print(now.day(), DEC);
lcd.print("/");
lcd.print(now.month(), DEC);
lcd.print("/");
lcd.print(now.year(), DEC);
lcd.print(" ");
lcd.setCursor(0, 1);
if (now.hour()<10)
lcd.print("0");
lcd.print(now.hour(), DEC);
lcd.print(",");
if (now.minute()<10)
lcd.print("0");
lcd.print(now.minute(), DEC);
lcd.print(":");
if (now.second()<10)
lcd.print("0");
lcd.print(now.second(), DEC);
delay(1000);
}
---
MERCI DE ME PROPOSER VOS SOLUTIONS !!!
A voir également:
- Arduino does not name a type
- Clear type - Guide
- Do not turn off target traduction ✓ - Forum Samsung
- Samsung bloqué: downloading ... do not turn off target - Forum Samsung
- Type de ram - Guide
- Message d'erreur ? " downloading... do not turn off target " ✓ - Forum Samsung