Home > electronica > Ceas de timp real RTC cu DS1307 si Arduino

Ceas de timp real RTC cu DS1307 si Arduino

Ceas de timp real RTC cu DS1307 si Arduino

RTC-DS1307 LCD-RC0802A Arduino 2009 - Atmega328

RTC-DS1307 LCD-RC0802A Arduino 2009 – Atmega328

RTC-DS1307 LCD-RC0802A Arduino 2009 - Atmega328

RTC-DS1307 LCD-RC0802A Arduino 2009 – Atmega328

Schema modulului RTC cu DS1307 si EEPROM 24C32 (opt. DS18B20)

Schema modulului RTC cu DS1307 si EEPROM 24C32 (opt. DS18B20)

Conectarea modului RTC DS1307 la Arduino Duemilanove

Conectarea modului RTC DS1307 la Arduino Duemilanove

/* Exemplu utilizarea librarie MD_DS1307 si afisare pe LCD 8×2, fara posibilitatea de reglare a ore */

/* Tema:  “Reglarea orei si a datei prin Serial Monitor” */

#include <LiquidCrystal.h>
#include <MD_DS1307.h>
#include <Wire.h>

LiquidCrystal lcd(11, 10, 9, 8, 7, 6);  //conexiunile LCD-ului RC0802A la placa Arduino (RS, E, D4, D5, D6, D7)

void setup()
{
lcd.begin(8,2);
lcd.clear();
lcd.noCursor();
}

void p2dig(uint8_t v)
// print 2 digits leading zero
{
if (v < 10) lcd.print(“0”);
lcd.print(v);
}

void printTime()
{
lcd.setCursor(0,0);
p2dig(RTC.dd);
lcd.print(“/”);
p2dig(RTC.mm);
lcd.print(“/”);
int year;
year = RTC.yyyy – 2000;
lcd.print(year);

lcd.setCursor(0,1);
p2dig(RTC.h);
lcd.print(“:”);
p2dig(RTC.m);
lcd.print(“:”);
p2dig(RTC.s);
}

void loop()
{
RTC.ReadTime();
printTime();
delay(100);
}

 

Descarca catalogul ciruitului – DS1307

  1. No comments yet.
  1. No trackbacks yet.

*