sleemanj / DS3231_Simple

An Arduino Library for EASY communication with DS3231 I2C RTC Clock and Atmel AT24C32 I2C EEPROM commonly found on the same board. Implements setting, getting the time/date, setting, checking and clearing alarms, and dead-easy circular-buffered logging of data with timestamp.
MIT License
82 stars 25 forks source link

store clock.printToDate() / clock.printToTime() in a variable #1

Closed AleixF closed 7 years ago

AleixF commented 7 years ago

hi, I am trying to store the value of clock.printToDate_DMY() and clock.printToTime_HM() in two variables, is this possible? I got print it in serial monitor but I don't know how store those values in a variable to be stored in a SD card.

sleemanj commented 7 years ago

See examples/z1_TimeAndDate/ReadDateTime

https://github.com/sleemanj/DS3231_Simple/blob/master/examples/z1_TimeAndDate/ReadDateTime/ReadDateTime.ino

once you have your data in MyDateAndTime you can do what you like with the Hour, Minute, Second etc as you please.