Should SPI be an import from pyb, or from machine? The document here indicates to import from machine:
https://docs.micropython.org/en/latest/ ... e.SPI.html
But the pyboard quick reference imports from pyb:
https://docs.micropython.org/en/latest/ ... ml#pyb-spi
The methods are different as well. When importing from machine, methods include SPI.read and SPI.write.
Whereas when importing from pyb, methods include SPI.send and SPI.recv.
My code only seems to run if I import from machine. I haven't successfully communicated with my peripheral, so by run I mean that there does not seem to be a coding error (a call to light an LED at the end of the program works when I import SPI from machine, but not when I import from pyb).
Thanks for any advice
Regards
Andy
SPI Import Question
Re: SPI Import Question
use machine.SPI, which is the more recent style and portable across the various ports.