spi.read(5) # réception de 5 bytes/octets sur le bus
rbuf = bytearray(5)
rbuf = bytearray(5)
−
spi.write_readinto('hello', rbuf) # send a receive 5 bytes
+
spi.write_readinto('hello', rbuf) # envoyer et recevoir 5 bytes/octets
</syntaxhighlight>
</syntaxhighlight>
+
+
Si vous avez besoin d'exemple l'envoi {{underline|et réception}} de donnée sur le bus SPI, vous pouvez consulter le projet de [https://github.com/ropod7/pyboard_drive pyboard_drive] (''GitHub de Roman Podgaiski'') et plus particulièrement le pilote concernant ILI9341 permettant de prendre le contrôle d'un écran TFT. La bibliothèque est certes écrite pour une carte MicroPython PyBoard mais c'est du MicroPython. Roman a été amené à faire des lectures dans la RAM de l'écran via le bus SPI. Ce projet est donc une excellente source d'information.