File Organisation

This commit is contained in:
LazyAssassin445
2017-02-24 11:47:46 +00:00
parent 8a27c1bc89
commit 0d8e8f7a97
2 changed files with 0 additions and 0 deletions

17
testprograms/spitest Executable file
View File

@@ -0,0 +1,17 @@
#!/usr/bin/python
import spidev
import time
import os
spi = spidev.SpiDev()
spi.open(0, 0)
def readchannel(channel):
adc = spi.xfer2([1, (8+channel)<<4, 0])
data = ((adc[1]&3)<<8) + adc[2]
return data
while True:
print(readchannel(7))
time.sleep(.5)