Day 3 Script added
This commit is contained in:
parent
f7a0c34f40
commit
fcf71d1d3f
24
3-dezember.py
Normal file
24
3-dezember.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
from machine import Pin
|
||||||
|
import time
|
||||||
|
|
||||||
|
knopf1 = Pin(13, Pin.IN, Pin.PULL_DOWN)
|
||||||
|
knopf2 = Pin(8, Pin.IN, Pin.PULL_DOWN)
|
||||||
|
knopf3 = Pin(3, Pin.IN, Pin.PULL_DOWN)
|
||||||
|
rot = Pin(20, Pin.OUT)
|
||||||
|
gelb = Pin(19, Pin.OUT)
|
||||||
|
gruen = Pin(18, Pin.OUT)
|
||||||
|
rot.value(0)
|
||||||
|
gelb.value(0)
|
||||||
|
gruen.value(0)
|
||||||
|
|
||||||
|
while True:
|
||||||
|
time.sleep(0.2)
|
||||||
|
|
||||||
|
if knopf1.value() == 1:
|
||||||
|
print("Knopf 1 gedrückt")
|
||||||
|
rot.toggle()
|
||||||
|
if knopf2.value() == 1:
|
||||||
|
print("Knpf 2 gedrückt")
|
||||||
|
gelb.toggle()
|
||||||
|
if knopf3.value() == 1:
|
||||||
|
gruen.toggle()
|
Loading…
Reference in New Issue
Block a user