为什么使用spidev发送的消息在从ADC接收位时发生变化?

2024-10-02 08:20:59 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用SpiDev模块(https://github.com/doceme/py-spidev)控制Raspberry Pi上的Texas Instruments ADS1261EVM(并使用Python编程)

当我发送存储为变量的消息时,xfer2函数似乎会改变发送的消息变量

import spidev
spi = spidev.SpiDev()
spi.open(0,0)
send = [0x20,0x0,0x0]
print (send) # to verify that the message is [0x20,0x0,0x0]
received = spi.xfer2(send)
print(send, received) # prints [received] [received]

为什么变量send在收到时会被覆盖


Tags: 模块pyhttpsgithubspicomsend消息

热门问题