Μετάβαση στο κύριο περιεχόμενο

Αναρτήσεις

Προβολή αναρτήσεων από Οκτωβρίου 29, 2024

Αρχικοποίηση rtc ρολογιού

 // Initialize rtc clock #include <Wire.h> #include <DS1307RTC.h> const char * monthName [ 12 ] = {   "Jan" , "Feb" , "Mar" , "Apr" , "May" , "Jun" ,   "Jul" , "Aug" , "Sep" , "Oct" , "Nov" , "Dec" } ; tmElements_t tm; void setup () {   Serial . begin ( 9600 ) ;   while ( !Serial ) ; // wait for serial   delay ( 200 ) ;   bool parse= false ;   bool config= false ;   // get the date and time the compiler was run   if ( getDate ( __DATE__ ) && getTime ( __TIME__ )) {     parse = true ;     // and configure the RTC with this info     if ( RTC . write ( tm )) {       config = true ;     }   }   if ( parse && config ) {     Serial . print ( "DS1307 configured Time=" ) ;     Serial . print ( __TIME__ ) ;     Serial . print ( ", Date=" ) ;     Serial . println ( __DATE__ ) ;   } else if ...