Modifications

Sauter à la navigation Sauter à la recherche
461 octets ajoutés ,  13 juin 2016 à 09:23
Ligne 79 : Ligne 79 :     
== Bus SPI (todo) ==
 
== Bus SPI (todo) ==
 +
 +
TODO
 +
 +
voir {{fname|machine.SPI}} exemple provenant de [http://docs.micropython.org/en/latest/wipy/wipy/quickref.html#spi-bus micropython.org/wipy]
 +
 +
<syntaxhighlight lang="python">
 +
from machine import SPI
 +
 +
# configure the SPI master @ 2MHz
 +
spi = SPI(0, SPI.MASTER, baudrate=200000, polarity=0, phase=0)
 +
spi.write('hello')
 +
spi.read(5) # receive 5 bytes on the bus
 +
rbuf = bytearray(5)
 +
spi.write_readinto('hello', rbuf) # send a receive 5 bytes
 +
</syntaxhighlight>
    
== Port SD (todo) ==
 
== Port SD (todo) ==
29 917

modifications

Menu de navigation