Cra*_*ker 6 python temperature python-3.x gpio raspberry-pi
我是覆盆子Pi的GPIO部分的新手.当我需要引脚时,我通常只使用Arduino.但是如果可能的话,我真的希望将这个项目合并到一个平台上,我想在PI上完成所有这些工作.
所以我有三(3)个MAX31855板和K型热电偶.我只是不知道在哪里连接其他两个.我不知道我是否可以使用任何其他引脚(电源和接地引脚除外)用于MISO,CSO和SCLK引脚.这可能听起来像一个菜鸟问题,但就像我说我习惯使用arduino这个东西.任何输入都表示赞赏.提前致谢.
我正在使用https://github.com/Tuckie/max31855中的代码
from max31855 import MAX31855, MAX31855Error
cs_pin=24
clock_pin=23
data_pin=22
unit="f"
thermocouple1=MAX31855(cs_pin, clock_pin, data_pin, units)
print(thermocouple.get())
thermocouple.cleanup()
Run Code Online (Sandbox Code Playgroud)
您可以在设备之间共享MISO
和SCLK
线路,然后每个设备都需要自己的设备CS
.就像是:
在这种情况下Master
是Pi,而Slaves是MAX31855.SS(从选择)与CS(片选)相同.
from max31855 import MAX31855, MAX31855Error
cs_pin_1=24
clock_pin=23
data_pin=22
cs_pin_2=21
cs_pin_3=20
units = "f"
thermocouple1=MAX31855(cs_pin_1, clock_pin, data_pin, units)
thermocouple2=MAX31855(cs_pin_2, clock_pin, data_pin, units)
thermocouple3=MAX31855(cs_pin_3, clock_pin, data_pin, units)
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
3833 次 |
最近记录: |