background image

    RTC.set(DS1307_DATE, 12); 

    RTC.set(DS1307_MTH, 2); 

    RTC.set(DS1307_YR, 12); 

    //start rtc time 

    RTC.start(); 

  } 

  //RTC.SetOutput(LOW); 

  //RTC.SetOutput(HIGH); 

  //RTC.SetOutput(DS1307_SQW1HZ); 

  //RTC.SetOutput(DS1307_SQW4KHZ); 

  //RTC.SetOutput(DS1307_SQW8KHZ); 

  RTC.SetOutput(DS1307_SQW32KHZ); 

 

void loop() 

  int i; 

  //get current time  

  RTC.get(rtc, true); 

  //print current time format : year month day week hour min sec 

  for (i = 0; i < 7; i++) 

  { 

    Serial.print(rtc[i]); 

    Serial.print(" "); 

  } 

  //blink the light 

  Serial.println(); 

  digitalWrite(ledPin, HIGH); 

  delay(500); 

  digitalWrite(ledPin, LOW); 

  delay(500); 

  // 

  int j = 0; 

  //read all the data 

Downloaded from

Arrow.com.

Downloaded from

Arrow.com.

Downloaded from

Arrow.com.

Downloaded from

Arrow.com.

Отзывы: