Update README.rst and example

This commit is contained in:
Pierrick C
2020-03-29 18:04:38 +02:00
parent 701a8d6b7e
commit b3fed3db83
2 changed files with 12 additions and 43 deletions

View File

@ -2,17 +2,20 @@
# Will print the temperature every second.
import time
import board
import busio
import digitalio
import machine
import adafruit_max31865
# Initialize SPI bus and sensor.
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
cs = digitalio.DigitalInOut(board.D5) # Chip select of the MAX31865 board.
sensor = adafruit_max31865.MAX31865(spi, cs)
spi=machine.SPI(
-1,
sck=machine.Pin(14, machine.Pin.OUT),
mosi=machine.Pin(13, machine.Pin.OUT),
miso=machine.Pin(12, machine.Pin.OUT)
)
spi.init(baudrate=115200, polarity=0, phase=1)
cs=machine.Pin(2)
sensor=adafruit_max31865.MAX31865(spi, cs)
# Note you can optionally provide the thermocouple RTD nominal, the reference
# resistance, and the number of wires for the sensor (2 the default, 3, or 4)
# with keyword args: