º» Á¦Ç°Àº DS1307À» ÀÌ¿ëÇÑ RTC ¸ðµâÀÌ¸ç ½Ç½Ã°£À¸·Î ½Ã°£À» I2C Åë½ÅÀ¸·Î º¸³»ÁÖ´Â ¸ðµâÀÔ´Ï´Ù.
¸ÕÀú ÇöÀç ½Ã°£À¸·Î ¸ÂÃçÁÖ°í ³ ÈÄ¿¡ »ç¿ëÇÏ¿©¾ÆÇϸç 2032 Å©±âÀÇ ÄÚÀϼ¿ ¹èÅ͸®¸¦ »ç¿ëÇÕ´Ï´Ù.
¿ÏÃæµÈ ÄÚÀμ¿ ¹èÅ͸®¸¦ ³¢¿öÁÖ¸é 1³âµ¿¾È °¥¾Æ ³¢¿öÁÖÁö ¾Ê¾Æµµ µË´Ï´Ù.
ÀÔ·Â Àü¿ø : 5V »ç¿ë Àü·ù : 500§Ë
½Ã°£ ¼³Á¤ ÄÚµå #include #include "RTClib.h" RTC_DS1307 RTC; void setup () { Serial.begin(57600); // UART initialize Wire.begin(); RTC.begin(); RTC.adjust(DateTime("Mar 11 2014","15:31:00")); // ÇöÀç½Ã°£À» ¼³Á¤ÇÒ ¼ö ÀÖ½À´Ï´Ù. ¼³Á¤ÀÌ µÇ¾ú´Ù¸é ´ÙÀ½ ¾÷·Îµù ¶§´Â Áö¿ì¼Åµµ µË´Ï´Ù. } void loop () { DateTime now = RTC.now(); // Sending date & time to UART every second 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(); delay(1000); } ________________________________________________________________________________________________________ ¾ÆµÎÀ̳ë¿Í RTC ¸ðµâ°úÀÇ ¿¬°á¹æ¹ýÀº ´ÙÀ½°ú °°½À´Ï´Ù. RTC ¸ðµâ ------------- ¾ÆµÎÀ̳ë VCC ----------------- VCC GND ----------------- GND SDA ----------------- A4 SCL ----------------- A5
|