예제 #1
0
#!/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()
예제 #2
0
#!/usr/bin/env python3
"""This example shows how to use the Thermo3 Click wrapper of the LetMeCreate
library.

It reads the temperature from the sensor and exits.

The Thermo3 Click must be inserted in Mikrobus 1 before running this program.


"""

from letmecreate.core import i2c
from letmecreate.core.common import MIKROBUS_1
from letmecreate.click import thermo3

# Initialise I2C on Mikrobus 1
i2c.init()
i2c.select_bus(MIKROBUS_1)

# Read temperature
thermo3.enable(0)
print('{} degrees celsius'.format(thermo3.get_temperature()))
thermo3.disable()

# Release I2C
i2c.release()