On Tue, 30 Jul 2019 15:27:55 -0700 (PDT), Frederico Alves de Oliveira Silva
<
freder...@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.
--
Wulfraed Dennis Lee Bieber AF6VN
wlf...@ix.netcom.com http://wlfraed.microdiversity.freeddns.org/