Using digital potentiometer MCP41010 with BeagleBone Black

Hello guys,

I am using a BeagleBone Black with an digital potentiometer MCP41010.

I did the connections between the two devices and run the code in python below:

import Adafruit_BBIO.SPI as SPI

from Adafruit_BBIO.SPI import SPI
# spi = SPI(bus, device) #/dev/spidev<bus>.<device>

# /dev/spidev0.0
spi = SPI(0, 0)
print(spi.xfer2([127]))
spi.close()

The output of the code should be: 127
But I only get: 255

Can anyone help me?

On Tue, 30 Jul 2019 15:27:55 -0700 (PDT), Frederico Alves de Oliveira Silva
<frederico.aos@gmail.com> declaimed the
following:

import Adafruit_BBIO.SPI as SPI
from Adafruit_BBIO.SPI import SPI# spi = SPI(bus, device) #/dev/spidev<bus>.<device>
# /dev/spidev0.0spi = SPI(0, 0)print(spi.xfer2([127]))spi.close()
The output of the code should be: 127

  No... the output of that mess will be nothing -- please post using a
client that doesn't wipe out line endings when pasting code. As is, there
are only two viable statements in that and those are two conflicting import
statements

import Adafruit_BBIO.SPI as SPI
from Adafruit_BBIO.SPI import SPI

Everything else appears behind # comment markers

But I only get: 255

  Well, why do you expect the result to be 127? You may be sending 127 to
the device, but the device could be sending back whatever value it
initialized with -- and since you appear to be opening and closing the
device each time, there is no assurance the device didn't reset to maximum
each time you try.

On Tue, 13 Aug 2019 20:32:25 -0400, Dennis Lee Bieber
<wlfraed@ix.netcom.com> declaimed the following:

Well, why do you expect the result to be 127? You may be sending 127 to
the device, but the device could be sending back whatever value it
initialized with -- and since you appear to be opening and closing the
device each time, there is no assurance the device didn't reset to maximum
each time you try.

  Glancing at a data sheet, the 41010 doesn't even have an output, so
there is nothing you can be reading (so, if MISO is tied high, it may be
reading 1s on each clock)