Bit of lint on simpletest
This commit is contained in:
parent
02b04b57e9
commit
f199693424
@ -1,21 +1,18 @@
|
|||||||
# Simple demo of the MAX31865 thermocouple amplifier.
|
"""Simple demo of the MAX31865 thermocouple amplifier.
|
||||||
# Will print the temperature every second.
|
Will print the temperature every second."""
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import machine
|
import machine
|
||||||
import adafruit_max31865
|
import adafruit_max31865
|
||||||
|
|
||||||
|
|
||||||
# Initialize SPI bus and sensor.
|
# Initialize SPI bus and sensor.
|
||||||
spi=machine.SPI(
|
SPI = machine.SPI(-1, sck=machine.Pin(14, machine.Pin.OUT),
|
||||||
-1,
|
|
||||||
sck=machine.Pin(14, machine.Pin.OUT),
|
|
||||||
mosi=machine.Pin(13, machine.Pin.OUT),
|
mosi=machine.Pin(13, machine.Pin.OUT),
|
||||||
miso=machine.Pin(12, machine.Pin.OUT)
|
miso=machine.Pin(12, machine.Pin.OUT)
|
||||||
)
|
)
|
||||||
spi.init(baudrate=115200, polarity=0, phase=1)
|
SPI.init(baudrate=115200, polarity=0, phase=1)
|
||||||
cs=machine.Pin(2)
|
CS = machine.Pin(2)
|
||||||
sensor=adafruit_max31865.MAX31865(spi, cs)
|
SENSOR = adafruit_max31865.MAX31865(SPI, CS)
|
||||||
# Note you can optionally provide the thermocouple RTD nominal, the reference
|
# 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)
|
# resistance, and the number of wires for the sensor (2 the default, 3, or 4)
|
||||||
# with keyword args:
|
# with keyword args:
|
||||||
@ -24,8 +21,8 @@ sensor=adafruit_max31865.MAX31865(spi, cs)
|
|||||||
# Main loop to print the temperature every second.
|
# Main loop to print the temperature every second.
|
||||||
while True:
|
while True:
|
||||||
# Read temperature.
|
# Read temperature.
|
||||||
temp = sensor.temperature
|
TEMP = SENSOR.temperature
|
||||||
# Print the value.
|
# Print the value.
|
||||||
print("Temperature: {0:0.3f}C".format(temp))
|
print("Temperature: {0:0.3f}C".format(TEMP))
|
||||||
# Delay for a second.
|
# Delay for a second.
|
||||||
time.sleep(1.0)
|
time.sleep(1.0)
|
||||||
|
Loading…
Reference in New Issue
Block a user