from machine import Pin
import utime
"""
Ampelphasen siehe: https://www.wien.gv.at/verkehr/ampeln/ampelkunde.html
Wokwi-Anleitung: https://docs.wokwi.com/de-DE/parts/wokwi-pi-pico
Firmware-Download für micropython: https://micropython.org/download/RPI_PICO/
Raspberry Pi pico: https://www.raspberrypi.com/documentation/microcontrollers/raspberry-pi-pico.html
Raspberry Pi Pico SDK: https://datasheets.raspberrypi.com/pico/raspberry-pi-pico-python-sdk.pdf?_gl=1*1nslkjw*_ga*MTUwMzc0ODI0NS4xNzA5ODk1ODE0*_ga_22FD70LWDS*MTcwOTg5NTgxNC4xLjEuMTcwOTg5NTg5Ny4wLjAuMA..
MicroPython Dokumentation: https://docs.micropython.org/en/latest/
"""
red = Pin(28, Pin.OUT)
yellow = Pin(27, Pin.OUT)
green = Pin(26, Pin.OUT)
# siehe: https://docs.micropython.org/en/latest/library/machine.Pin.html#machine-pin
while True:
red.value(1)
yellow.value(0)
green.value(0)
utime.sleep(3) # siehe: https://docs.micropython.org/en/v1.15/library/utime.html#functions
red.value(1)
yellow.value(1)
green.value(0)
utime.sleep(1)
red.value(0)
yellow.value(0)
green.value(1)
utime.sleep(3)
for i in range(4):
green.value(0)
utime.sleep(0.2)
green.value(1)
utime.sleep(0.2)
red.value(0)
yellow.value(1)
green.value(0)
utime.sleep(1)