Änderungen

Aus Linkerkit.de

Wechseln zu: Navigation, Suche

LK-Button2

393 Byte entfernt, 14:29, 19. Okt. 2016
/* Codebeispiel Raspberry Pi */
==Codebeispiel Raspberry Pi==
<pre class="brush:py">import RPi.GPIO as GPIO<br data-attributes="%20/" /><br data-attributes="%20/" /> #Initialisiere LED auf Digital-PIN 4 und Button auf Digital-PIN 15 & 16<br data-attributes="%20/" />led = 4<br data-attributes="%20/" />button1 = 15<br data-attributes="%20/" />button2 = 16 <br data-attributes="%20/" />GPIO.setwarnings(False)<br data-attributes="%20/" />GPIO.setmode(GPIO.BCM)<br data-attributes="%20/" />GPIO.setup(button1, GPIO.IN, pull_up_down=GPIO.PUD_UP)<br data-attributes="%20/" />GPIO.setup(button2, GPIO.IN, pull_up_down=GPIO.PUD_UP)<br data-attributes="%20/" />GPIO.setup(led, GPIO.OUT) <br data-attributes="%20/" />while True:<br data-attributes="%20/" /> if GPIO.input(button1) == GPIO.HIGH:<br data-attributes="%20/" /> GPIO.output(led, True)<br data-attributes="%20/" /> if GPIO.input(button2) == GPIO.HIGH:<br data-attributes="%20/" /> GPIO.output(led, False)</pre>
==Downloads==
Infos: [[Medium:001267833-da-01-en-linker_kit_platine_beschleun_bewegungs_.pdf]]
Schaltung: [[Medium:001267833-sp-01-en-linker_kit_platine_beschleun_bewegungs_.pdf]]