Escolar Documentos
Profissional Documentos
Cultura Documentos
Real Time Clock DS1307 (RTC) + Arduino
Real Time Clock DS1307 (RTC) + Arduino
1 de 7
http://lusorobotica.com/index.php?topic=681.0
16/11/2013 00:15
2 de 7
http://lusorobotica.com/index.php?topic=681.0
16/11/2013 00:15
3 de 7
http://lusorobotica.com/index.php?topic=681.0
16/11/2013 00:15
4 de 7
http://lusorobotica.com/index.php?topic=681.0
ds1307get(i, 0)
16/11/2013 00:15
5 de 7
http://lusorobotica.com/index.php?topic=681.0
switch(c){
case DS1307_SEG:
v=(10*((rtc_bcd[DS1307_SEG] & DS1307_HI_SEG)>>4))+(rtc_bcd[DS1307_SEG]
break;
case DS1307_MIN:
DS1307_SEG
// Adquire os dados do ar
if(refresh) ds1307read();
for(byte i=0;i<7;i++)rtc[i]=ds1307get(i, 0);
}
int ds1307get(byte c, boolean refresh){
if(refresh) ds1307read();
int v=-1;
switch(c){
case DS1307_SEG:
v=(10*((rtc_bcd[DS1307_SEG] & DS1307_HI_SEG)>>4))+(rtc_bcd[DS1307_SEG]
break;
case DS1307_MIN:
v=(10*((rtc_bcd[DS1307_MIN] & DS1307_HI_MIN)>>4))+(rtc_bcd[DS1307_MIN]
break;
case DS1307_HR:
16/11/2013 00:15
6 de 7
http://lusorobotica.com/index.php?topic=681.0
...
switch(c){
case DS1307_SEG:
v=(10*((rtc_bcd[DS1307_SEG] & DS1307_HI_SEG)>>4))+(rtc_bcd[DS1307_SEG]
// inseres a linha que se segue
Serial.println(rtc_bcd[DS1307_SEG], BIN); // Esta linha, Atencao esta
// inseres a linha de cima, a que passou :P
break;
case DS1307_MIN:
v=(10*((rtc_bcd[DS1307_MIN] & DS1307_HI_MIN)>>4))+(rtc_bcd[DS1307_MIN]
break;
...
16/11/2013 00:15
7 de 7
http://lusorobotica.com/index.php?topic=681.0
=> Tutoriais OK
'
,
'
16/11/2013 00:15