I'm doing a project with DC motors. Then I use the beaglebone black 
connecting with a encodercounter of LS7366R to read the encoder data of the 
DC motor. while when I send command to this chip. I only get 255 return. 
the coder is shown as following. anyone knows how to fix it? the LS7366R 
board is from here LS7366R board 
<https://www.superdroidrobots.com/shop/item.aspx/single-ls7366r-quadrature-encoder-buffer/2397/>


from Adafruit_BBIO.SPI import SPI

import time

spi=SPI(0,0)
spi.msh=10000
spi.bpw=8
spi.threewire=False
spi.lsbfirst = False
spi.cshigh = False
spi.open(0,0)

spi.xfer2([0x88,0x03])#set the counter to 4bytes mode


#read back data
try:
  while True:
encoderCount=spi.xfer2([0x60,0x00,0x00,0x00,0x00])
       


        print encoderCount
        sleep(0.2)

except KeyboardInterrupt:
        spi.close()
        print  "all done"

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/e7190f94-b178-4302-910f-ad00f38a6416%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to