15-10-2018, 23:00
(Ten post był ostatnio modyfikowany: 16-10-2018, 12:36 przez CEO.
Powód edycji: Proszę używać znaczników [code]
)
Witam serdecznie załóżmy że chciał bym zapisać dane z zegara RTC na karcie pamięci mógł by mi ktoś pomóc nie mam bladego pojęcia jak to zrobić
to jest mój kod będzie zmodyfikowany ale wystarczy:
to jest mój kod będzie zmodyfikowany ale wystarczy:
Kod:
#include <DS3232RTC.h>
void setup()
{
Serial.begin(9600);
setSyncProvider(RTC.get); // the function to get the time from the RTC
if(timeStatus() != timeSet)
Serial.println("Unable to sync with the RTC");
else
Serial.println("RTC has set the system time");
}
void loop()
{
digitalClockDisplay();
delay(1000);
}
void digitalClockDisplay()
{
// digital clock display of the time
Serial.print(hour());
printDigits(minute());
printDigits(second());
Serial.print(' ');
Serial.print(day());
Serial.print(' ');
Serial.print(month());
Serial.print(' ');
Serial.print(year());
Serial.println();
}
void printDigits(int digits)
{
// utility function for digital clock display: prints preceding colon and leading 0
Serial.print(':');
if(digits < 10)
Serial.print('0');
Serial.print(digits);
}