Änderungen

Aus Linkerkit.de

Wechseln zu: Navigation, Suche

LK-Temp

511 Byte hinzugefügt, 15:31, 19. Okt. 2016
/* Codebeispiel Raspberry */
==Codebeispiel Raspberry==
 <pre class="brush:py">import spidevfrom time import sleep # Initialisiere Temp-Sensor auf Analogen-PIN 0temp = 0 spi = spidev.SpiDev()spi.open(0,0) def readadc(adcnum):# SPI-Daten auslesen r = spi.xfer2([1,8+adcnum <<4,0]) adcout = ((r[1] &3) <<8)+r[2] return adcout while True: value = readadc(temp) volts = (value * 3.3) / 1024 temperature_C = (volts - 0.5) * 100  print("Temperatur: " + str(temperature_C) +  " C") print(" ") sleep(1)</pre> 
==Downloads==
Infos:<br />Englisch: [[Medium:001267861-da-01-en-LINKER_KIT_PLATINE_MIT_TEMPARATURSENSOR.pdf|001267861-da-01-en-LINKER_KIT_PLATINE_MIT_TEMPARATURSENSOR.pdf]]
Schaltung: [[Medium:001267861-sp-01-en-LINKER_KIT_PLATINE_MIT_TEMPARATURSENSOR.pdf|001267861-sp-01-en-LINKER_KIT_PLATINE_MIT_TEMPARATURSENSOR.pdf]]