We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent baff205 commit 2bb2a13Copy full SHA for 2bb2a13
examples/thermo3_example.py
@@ -0,0 +1,21 @@
1
+#!/usr/bin/env python3
2
+"""This example shows how to read the temperature using a Thermo3 Click
3
+on Mikrobus 1.
4
+"""
5
+
6
+from letmecreate.core import i2c
7
+from letmecreate.core.common import MIKROBUS_1
8
+from letmecreate.click import thermo3
9
10
11
+# Initialise I2C on Mikrobus 1
12
+i2c.init()
13
+i2c.select_bus(MIKROBUS_1)
14
15
+# Read temperature
16
+thermo3.enable(0)
17
+print('{} degrees celsius'.format(thermo3.get_temperature()))
18
+thermo3.disable()
19
20
+# Release I2C
21
+i2c.release()
0 commit comments