Änderungen

Aus Linkerkit.de

Wechseln zu: Navigation, Suche

LK-Touch

346 Byte hinzugefügt, 15:04, 19. Okt. 2016
/* Codebeispiel Raspberry */
 
==Codebeispiel Raspberry==
 <pre class="brush:py">import RPi.GPIO as GPIO led = 4touch = 15 GPIO.setwarnings(False)GPIO.setmode(GPIO.BCM)GPIO.setup(led, GPIO.OUT)GPIO.setup(touch, GPIO.IN, pull_up_down=GPIO.PUD_UP) while True: if GPIO.input(touch) == GPIO.HIGH: GPIO.output(led, True) else: GPIO.output(led, False)</pre>