Skip to main content

Inkplate 6COLOR – Basic RTC usage

This page shows how to use the onboard PCF85063A RTC to measure and keep track of time.


RTC Set Time/Date

from inkplate6COLOR import Inkplate
import time

# Create Inkplate object
inkplate = Inkplate()

# Initialize the display
inkplate.begin()

# Set the RTC's time
inkplate.rtcSetTime(9, 39, 10)
# Set the RTC's date
inkplate.rtcSetDate(4, 24, 9, 2025)

# Infinite loop
while True:
# Get RTC time data (returns dictionary)
rtc_data = inkplate.rtcGetData()

# Clear the display buffer
inkplate.clearDisplay()
inkplate.setCursor(5, 5)

# Print every RTC time parameter
inkplate.println("RTC Date & Time:")
inkplate.println(f" Year : {rtc_data['year']}")
inkplate.println(f" Month : {rtc_data['month']}")
inkplate.println(f" Day : {rtc_data['day']}")
inkplate.println(f" Weekday : {rtc_data['weekday']}")
inkplate.println(f" Hour : {rtc_data['hour']}")
inkplate.println(f" Minute : {rtc_data['minute']}")
inkplate.print(f" Second : {rtc_data['second']}")
inkplate.display()

# Pause for 10 seconds before updating the display
# Note: displayed time may not differ by exactly 10 seconds due to screen refresh time.
time.sleep(10)
Time date display on Inkplate
Time/Date display on Inkpalte

inkplate.rtcSetTime()

Sets the RTC's time

Function parameters:

TypeNameDescription
intrtc_hourSet hour
intrtc_minuteSet minutes
intrtc_secondSet seconds

inkplate.rtcSetDate()

Sets the RTC's specified date

Function parameters:

TypeNameDescription
intrtc_weekdaySet weekday
intrtc_daySet day in a month
intrtc_monthSet month
intrtc_yrSet year

inkplate.rtcGetData()

Returns current RTC time values

Returns type: Dictionary

Returns value: Return dictionary with RTC time values as integers