Bonjour à tous, j'ai un problème avec mon horloge Ds 1307 (DFR0151)
Je veux afficher l'heure et la date sur un module LCD, depuis ma carte arduino uno j'ai donc commandé le tout.
J'ai relié mon écran lcd qui fonctionne parfaitement, j'affiche ce que je veux dessus.
J'ai branché mon horloge a mon arduino et installé la librairie RTClib.
Branchements :
GND => masse
Vcc=> 5v
SDA => A4
SCL=> A5
J'ai suivi un tuto sur internet et ca marchais niquel. Puis je sais pas ce que j'ai fabriqué j'ai débranché la masse de l'horloga alors qu'elle était sous tension et depuis... A marche plus... Je me suis dis que j'avais grillé un composant et j'ai donc racheté une horloge.
Nouveau test et Bim bug...
Donc j'effectue les meme branchements, j'ouvre mon exemple DS1307 de ma librairie :
// Date and time functions using a DS1307 RTC connected via I2C and Wire lib
// 2010-02-04 jc@wippler.nl http://opensource.org/licenses/mit-license.php#include <Wire.h>
#include <RTClib.h>RTC_DS1307 RTC;
void setup () {
Serial.begin(57600);
Wire.begin();
RTC.begin();// following line sets the RTC to the date & time this sketch was compiled
//RTC.adjust(DateTime(DATE, TIME));
}void loop () {
DateTime now = RTC.now();Serial.print(now.year(), DEC);
Serial.print('/');
Serial.print(now.month(), DEC);
Serial.print('/');
Serial.print(now.day(), DEC);
Serial.print(' ');
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
Serial.println();Serial.print(" since 2000 = ");
Serial.print(now.get());
Serial.print("s = ");
Serial.print(now.get() / 86400L);
Serial.println("d");// calculate a date which is 7 days and 30 seconds into the future
DateTime future (now.get() + 7 * 86400L + 30);Serial.print(" now + 7d + 30s: ");
Serial.print(future.year(), DEC);
Serial.print('/');
Serial.print(future.month(), DEC);
Serial.print('/');
Serial.print(future.day(), DEC);
Serial.print(' ');
Serial.print(future.hour(), DEC);
Serial.print(':');
Serial.print(future.minute(), DEC);
Serial.print(':');
Serial.print(future.second(), DEC);
Serial.println();Serial.println();
delay(3000);
}
j'ouvre mon moniteur série pour voir ce que revoi mon horloge à 57600 baud et là :
2165/165/165 165:165:165
since 2000 = 443404065s = 5131d
now + 7d + 30s: 2014/1/25 23:48:152165/165/165 165:165:165
since 2000 = 443404065s = 5131d
now + 7d + 30s: 2014/1/25 23:48:15
Je me dis qu'il faut mettre à l'heure l'horloge.. Je decommente alors la ligne de mise à l'heure :
//RTC.adjust(DateTime(DATE, TIME));
et relance ma compilation et je reprogramme ma carte, mais non... Toujours la meme chose,
2165/165/165 165:165:165
since 2000 = 443404065s = 5131d
now + 7d + 30s: 2014/1/25 23:48:152165/165/165 165:165:165
since 2000 = 443404065s = 5131d
now + 7d + 30s: 2014/1/25 23:48:15
J'ai changé la pile, fait des recherches sur le net, je ne comprend pas pourquoi ca ne marche plus alors que ça fonctionnait avant...
Je me demande si je n'ai pas endomagé ma carte arduino...
MErci d'avance pour vos réponse:!
