#!/usr/bin/python import spidev #Bibliotheken importieren import time spi = spidev.SpiDev() #spi als Funktion definieren spi.open(0,1) while True: #eigentliche Programmschleife, die als Ausgabe Voltzahlen liefert antwort = spi.xfer([1,128,0]) if 0 < = antwort[1] <=3: wert = ((antwort[1] * 256) + antwort[2]) * 0.00322 print wert ," V" time.sleep(1)