树莓派上的多个热电偶 [英] Multiple thermocouples on raspberry pi

查看:191
本文介绍了树莓派上的多个热电偶的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对树莓派的GPIO部分还很陌生.当我需要引脚时,通常只使用Arduino.但是,如果可能的话,我真的希望将此项目整合到一个平台上,我希望在PI上全部完成.

I am pretty new to the GPIO part of the raspberry Pi. When I need pins I normally just use Arduino. However I would really like this project to be consolidated to one platform if possible, I would like to do it all on the PI.

因此,我有三(3)个 MAX31855 板,类型为K热电偶.我只是不知道该如何挂勾其他两个.我不知道是否可以将其他任何引脚(电源和接地引脚除外)用于MISO,CSO和SCLK引脚.这听起来像是一个菜鸟问题,但就像我说的那样,我已经习惯使用arduino了.任何输入表示赞赏.预先感谢.

So I have three (3) MAX31855 boards and type K Thermocouples. I just don't know where to go with hooking up the other two. I don't know if I can just use any other pins (besides power and ground pins) for the MISO, CSO, and SCLK pins. This may sound like a rookie question but like I said I'm used to using arduino for this stuff. Any input is appreciated. Thanks in advance.

我正在使用 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()

推荐答案

您可以在设备之间共享MISOSCLK行,然后每个设备将需要自己的CS.像这样:

You can share the MISO and SCLK lines among the devices, and then each device will need its own CS. Something like:

在这种情况下,Master是Pi,而从器件是MAX31855. SS(从选择)与CS(芯片选择)相同.

In this case Master is the Pi, and Slaves are the MAX31855's. SS (Slave Select) is the same as CS (Chip Select).

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)

这篇关于树莓派上的多个热电偶的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆