Skip to content

Commit 644a264

Browse files
authored
Merge pull request #4 from mrmcwethy/examples
added examples folder and simple example
2 parents 1668272 + c742fe9 commit 644a264

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

examples/simple.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import time
2+
import board
3+
import busio
4+
import digitalio
5+
import adafruit_max31855
6+
7+
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
8+
cs = digitalio.DigitalInOut(board.D5)
9+
10+
max31855 = adafruit_max31855.MAX31855(spi, cs)
11+
while True:
12+
tempC = max31855.temperature
13+
tempF = tempC * 9 / 5 + 32
14+
print('Temperature: {} C {} F '.format(tempC, tempF))
15+
time.sleep(2.0)

0 commit comments

Comments
 (0)