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 2bb2a13 commit 54f3c05Copy full SHA for 54f3c05
examples/proximity_example.py
@@ -0,0 +1,21 @@
1
+#!/usr/bin/env python3
2
+"""This example shows how to read a measure from the Proximity Click inserted
3
+in Mikrobus 1.
4
+"""
5
+
6
+from letmecreate.core import i2c
7
+from letmecreate.core.common import MIKROBUS_1
8
+from letmecreate.click import proximity
9
10
11
+# Initialise I2C on Mikrobus 1
12
+i2c.init()
13
+i2c.select_bus(MIKROBUS_1)
14
15
+# Read measure from Proximity Click
16
+proximity.enable()
17
+print('measure: {}'.format(proximity.get_measure()))
18
+proximity.disable()
19
20
+# Release I2C
21
+i2c.release()
0 commit comments