Free Shipping on ₹500+ Orders for New Customers!  |   Get 10% cashback on orders ₹500+ with your RBL Bank Patanjali Credit Card. Apply now and enjoy UPI-linked credit card benefits! *T&c applied.  |  Free Shipping on All Orders Above ₹1499  |   If you receive fraud calls from any number other than 01334-610100, 01334-610111, or 01334-691111, please ignore them. We do not send QR codes for payments.
0
Total ₹ 0.00
Checkout

// Open file and log dataFile = SD.open("datalog.txt", FILE_WRITE); if (dataFile) dataFile.print(myRTC.getDateStr()); dataFile.print(","); dataFile.print(myRTC.getTimeStr()); dataFile.print(","); dataFile.println(temperatureC); dataFile.close();

| Function | Syntax Example | Description | | :--- | :--- | :--- | | | VirtuabotixRTC(int clk, int dat, int rst) | Initializes the library with the three Arduino pins connected to the DS1302's CLK, DAT (I/O), and RST (CE) pins. | | updateTime() | rtc.updateTime(); | Reads the current time from the RTC chip and stores it in the object's internal variables. Must be called before reading time. | | setDS1302Time() | rtc.setDS1302Time(seconds, minutes, hours, dayOfWeek, date, month, year); | Writes a new time/date to the RTC chip. Typically called once during setup. | | Accessing Time | rtc.hours , rtc.minutes , rtc.seconds , rtc.dayofmonth , rtc.month , rtc.year , rtc.dayofweek | After updateTime() , these integer variables hold the current time components. |

The library is lightweight and focused solely on DS1302 functionality, making it ideal for microcontrollers with limited memory. Hardware Wiring