Embedded Development in Python

Read spidev in Python on BeagleBone Black

import spidev
import time

spi = spidev.SpiDev()
# open(bus, device)
spi.open(1, 0)
spi.max_speed_hz=50000
spi.mode = 0
while True:
        print spi.readbytes(5)
        time.sleep(1)