sensors or devices with SPI interface?


Author Message
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3888
Posted: 02:12pm 25 Jul 2021      

  matherp said  Should work - try the clock at 10000 and put a pause 1000 before reading the count pin


Thanks. After:

option count 9,10,11,12

setpin 19,spi1sck ' SPI1 SCK
setpin 20,spi1tx  ' SPI1 MOSI
setpin 16,spi1rx  ' SPI1 MISO
spi1 open 10000,0
setpin 9,cin
?SPI1(123);" ";: pause 1000: ?PIN(9)


Gives "123 8".