From fcf71d1d3f05bd8099d5f9a6ff24b60425493480 Mon Sep 17 00:00:00 2001 From: Joachim Hummel Date: Sun, 3 Dec 2023 10:50:05 +0000 Subject: [PATCH] Day 3 Script added --- 3-dezember.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 3-dezember.py diff --git a/3-dezember.py b/3-dezember.py new file mode 100644 index 0000000..6a98419 --- /dev/null +++ b/3-dezember.py @@ -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()