import
machine import utime led = machine.Pin(25, machine.Pin.OUT) led26 = machine.Pin(26, machine.Pin.OUT) while True: led.value(0) led26.value(0) utime.sleep(0.1) led.value(1) led26.value(1) utime.sleep(0.1) |
# SEMÁFORO PARA
RASPBERRY PI PICO # SETA43 # seta43.duckdns.org # seta43.blogspot.com # Palencia / España # 24-08-2022 import machine import utime sROJO = machine.Pin(18, machine.Pin.OUT) sAMARILLO = machine.Pin(19, machine.Pin.OUT) sVERDE = machine.Pin(20, machine.Pin.OUT) pROJO = machine.Pin(16, machine.Pin.OUT) pVERDE = machine.Pin(17, machine.Pin.OUT) tPARPADEO=0.4 tSEMAFORO=10 tAMARILLO=3 tPEATON=6 #INICIALIZAR sAMARILLO.value(1) sROJO.value(1) sVERDE.value(0) pROJO.value(1) pVERDE.value(0) utime.sleep(2) while True: sAMARILLO.value(0) sROJO.value(1) pROJO.value(0) pVERDE.value(1) utime.sleep(tPEATON) #PARPADEO VERDE PEATON for i in range(0, 7): pVERDE.value(0) utime.sleep(tPARPADEO) pVERDE.value(1) utime.sleep(tPARPADEO) pROJO.value(1) utime.sleep(1) sVERDE.value(1) sROJO.value(0) utime.sleep(tSEMAFORO) sAMARILLO.value(1) sVERDE.value(0) utime.sleep(tAMARILLO) |