DFRobot DS1307 Manuel - Page 5
Parcourez en ligne ou téléchargez le pdf Manuel pour {nom_de_la_catégorie} DFRobot DS1307. DFRobot DS1307 6 pages. Real time clock module
while (Serial.available() > 0)
{
comdata += char(Serial.read());
delay(2);
mark = 1;
}
//if data is all collected,then parse it
if (mark == 1)
{
Serial.println(comdata);
Serial.println(comdata.length());
//parse data
for (int i = 0; i < comdata.length() ; i++)
{
//if the byte is ',' jump it,and parse next value
if (comdata[i] == ',')
{
j++;
}
else
{
rr[j] = rr[j] * 10 + (comdata[i] - '0');
}
}
comdata = String("");
RTC.stop();
RTC.set(DS1307_SEC, rr[6]);
RTC.set(DS1307_MIN, rr[5]);
RTC.set(DS1307_HR, rr[4]);
RTC.set(DS1307_DOW, rr[3]);
RTC.set(DS1307_DATE, rr[2]);
RTC.set(DS1307_MTH, rr[1]);
RTC.set(DS1307_YR, rr[0]);
RTC.start();
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Arrow.com.
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from