18 lines
517 B
Python
18 lines
517 B
Python
from machine import Pin
|
|
import time
|
|
|
|
taster_hoch = Pin(1, Pin.IN, Pin.PULL_UP)
|
|
taster_runter = Pin(2, Pin.IN, Pin.PULL_UP)
|
|
taster_rechts = Pin(3, Pin.IN, Pin.PULL_UP)
|
|
taster_links = Pin(4, Pin.IN, Pin.PULL_UP)
|
|
|
|
def schleife():
|
|
if not taster_runter.value(): print('Runter gedrueckt!')
|
|
if not taster_rechts.value(): print('Rechts gedrueckt!')
|
|
if not taster_links.value(): print('Links gedrueckt!')
|
|
if not taster_hoch.value(): print('Hoch gedrueckt!')
|
|
|
|
while True:
|
|
schleife()
|
|
time.sleep(0.2)
|
|
|