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 35718a9 commit 19a948dCopy full SHA for 19a948d
source/examples/python/i2c.py
@@ -0,0 +1,12 @@
1
+#!/usr/bin/env python3
2
+# Read a TMP101 sensor
3
+
4
+import smbus
5
+import time
6
+bus = smbus.SMBus(1)
7
+address = 0x49
8
9
+while True:
10
+ temp = bus.read_byte_data(address, 0)
11
+ print (temp)
12
+ time.sleep(0.25)
source/examples/python/install.sh
@@ -0,0 +1,3 @@
+# Here's what you need to install to run these.
+sudo apt-get install python3-smbus
0 commit comments