I am using a modul max31865 and a pt100 sensor to measure the temperature but, I have a problem when i run the program,because appears this error
Traceback (most recent call last):
File "/home/pi/eduardo/videos/temperature.py", line 5, in <module>
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=board.MISO)
AttributeError: module 'board' has no attribute 'SCLK'
I don't know what the problem is.
import board
import busio
import digitalio
import adafruit_max31865
spi = busio.SPI(board.SCLK, MOSI=board.MOSI, MISO=board.MISO)
cs = digitalio.DigitalInOut(board.D5) # Chip select of the MAX31865 board.
sensor = adafruit_max31865.MAX31865(spi, cs, wires=3)
print('Temperature: {0:0.3f}C'.format(sensor.temperature))
print('Resistance: {0:0.3f} Ohms'.format(sensor.resistance))`enter code here`
I expect to read the temperature
Kind regards.
Are you very sure that should not be board.SCLK? Your code seems to be quite close to this example and that is how the constant is spelled there.
This did it for me
sudo pip3 install --force-reinstall adafruit-blinka
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With