Skip to main content

Inkplate 13SPECTRA MicroPython - Basic RTC usage

Inkplate 13SPECTRA comes with an onboard RTC (Real-Time Clock), which allows the board to keep track of the time and date even across reboots (as long as the backup battery is present)

ℹ️

To preserve time while the Inkplate is powered off, make sure a coin cell battery (CR2032) is installed in the RTC holder. Without it, the clck will reset when power is lost.

This example shows how to set the RTC time and date, and then continuously display the current time on the screen.


Basic RTC Example

# Include all the required libraries
from inkplate13SPECTRA import Inkplate
import time

# Create Inkplate object
inkplate = Inkplate()

# Initialize the display, needs to be called only once
inkplate.begin()

# This is how to set the RTC's time
# Arguments are hour, minute, seconds
inkplate.rtcSetTime(9,39,10)
# And this is the date
# Arguments are weekday, day in month, month and year
inkplate.rtcSetDate(2,9,2,2026)

# Infinite loop
while True:

# Show the set time
print(inkplate.rtcGetData())

# Let's wait 10 seconds
time.sleep(10)
Example output printed in console
Example output printed in console

inkplate.rtcSetTime()

Set the RTC's current time.

Function parameters:

TypeNameDescription
NumberhourHour (0–23).
NumberminuteMinute (0–59).
NumbersecondSecond (0–59).

inkplate.rtcSetDate()

Set the RTC's current date.

Function parameters:

TypeNameDescription
NumberweekdayDay of the week (1 = Monday … 7 = Sunday).
NumberdayDay of the month (1–31).
NumbermonthMonth (1–12).
NumberyearFull year (e.g., 2025).

inkplate.rtcGetData()

Read the current RTC date and time.

Returns value: Dictionary containing keys: `hour`, `minute`, `second`, `weekday`, `day`, `month`, `year`.


Full example

[LINK PLACEHOLDER - link to 13spectra rtc example]