상품상세 정보

뒤로가기
공급사 바로가기

C76 DS1307 RTC 리얼타임 클럭모듈 아두이노 시계

C76 DS1307 RTC 리얼타임 클럭모듈 아두이노 시계

기본 정보
판매가 2,200원 (부가세포함)
제조사 OEM
적립금 20 P
상품코드 P00000EI
국내·해외배송 국내배송
배송방법 택배
배송비 2,700원 (60,000원 이상 구매 시 무료)
수량 수량증가수량감소
배송
수량 down up  
상품 목록
상품 정보 가격 삭제
TOTAL PRICE 0
구매하기예약구매
 



 

* AT24C32 데이터시트

http://ww1.microchip.com/downloads/en/DeviceDoc/doc0336.pdf

* DS1307 데이터시트

https://datasheets.maximintegrated.com/en/ds/DS1307.pdf

 

** 다음은 아두이노와의 연결 및 샘플코드입니다.


 

#include "Wire.h"#define DS1307_I2C_ADDRESS 0x68  // the I2C address of Tiny RTCbyte second, minute, hour, dayOfWeek, dayOfMonth, month, year;// Convert normal decimal numbers to binary coded decimalbyte decToBcd(byte val){ return ( (val/10*16) + (val) );}// Convert binary coded decimal to normal decimal numbersbyte bcdToDec(byte val){ return ( (val/16*10) + (val) );}// Function to set the currnt time, change the second&minute&hour to the right timevoid setDateDs1307()                {  second =45;   minute = 29;  hour  = 13;  dayOfWeek = 2;  dayOfMonth =18;  month =9;  year= 12;  Wire.beginTransmission(DS1307_I2C_ADDRESS);  Wire.write(decToBcd(0));  Wire.write(decToBcd(second));    // 0 to bit 7 starts the clock  Wire.write(decToBcd(minute));  Wire.write(decToBcd(hour));      // If you want 12 hour am/pm you need to set                                  // bit 6 (also need to change readDateDs1307)  Wire.write(decToBcd(dayOfWeek));  Wire.write(decToBcd(dayOfMonth));  Wire.write(decToBcd(month));  Wire.write(decToBcd(year));  Wire.endTransmission();}// Function to gets the date and time from the ds1307 and prints resultvoid getDateDs1307(){ // Reset the register pointer Wire.beginTransmission(DS1307_I2C_ADDRESS); Wire.write(decToBcd(0)); Wire.endTransmission(); Wire.requestFrom(DS1307_I2C_ADDRESS, 7); second     = bcdToDec(Wire.read() & 0x7f); minute     = bcdToDec(Wire.read()); hour       = bcdToDec(Wire.read() & 0x3f);  // Need to change this if 12 hour am/pm dayOfWeek  = bcdToDec(Wire.read()); dayOfMonth = bcdToDec(Wire.read()); month      = bcdToDec(Wire.read()); year       = bcdToDec(Wire.read());   Serial.print(hour, DEC); Serial.print(":"); Serial.print(minute, DEC); Serial.print(":"); Serial.print(second, DEC); Serial.print("  "); Serial.print(month, DEC); Serial.print("/"); Serial.print(dayOfMonth, DEC); Serial.print("/"); Serial.print(year,DEC); Serial.print("  "); Serial.println(); //Serial.print("Day of week:");}void setup() { Wire.begin(); Serial.begin(19200); setDateDs1307(); //Set current time;}void loop() { delay(2000); getDateDs1307();//get the time data from tiny RTC }

 


 

 




 

상품결제정보

배송 안내

  • 배송 방법 : 택배
  • 배송 지역 : 전국지역
  • 배송 비용 : 2,700원
  • 배송 기간 : 3일 ~ 7일
  • 배송 안내 :

교환/반품 안내

서비스문의 안내

판매자 정보

게시물이 없습니다

글작성 모두보기

게시물이 없습니다

글작성 모두보기