#!/usr/bin/env python3
"""This example shows how to use the OLED Click wrapper of the LetMeCreate library.

It displays some text for three seconds and then, it exits.

The OLED Click must be inserted in Mikrobus 1 before running this program.
In addition, the OLED Click must be configured to use I2C.
"""

from letmecreate.core.common import MIKROBUS_1
from letmecreate.core import i2c
from letmecreate.click import oled
import time


i2c.init()

oled.enable(MIKROBUS_1)
oled.write_text("Hello   Creator!")
time.sleep(3)
oled.disable()

i2c.release()
Exemple #2
0
    "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday",
    "Sunday"
]

month_str = [
    "January", "Februay", "March", "April", "May", "June", "July", "August",
    "September", "October", "November", "December"
]

date = rtc.Date()
date.second = 0
date.minute = 44
date.hour = 9
date.weekday = FRIDAY
date.day = 28
date.month = OCTOBER
date.year = 2016

i2c.init()
rtc.init(2016)
rtc.set_date(date)

while True:
    date = rtc.get_date()
    print("{} {} {} {}, {}:{}:{}".format(weekday_str[date.weekday], date.day,
                                         month_str[date.month], date.year,
                                         date.hour, date.minute, date.second))
    sleep(1)

i2c_release()