# #############################################################################
# ** Proyecto : 3_3 Herencia Torre Leds
# ** Plataforma : ESP32 / WROOM
# ** Herramienta : https://www.wokwi.com
# ** : Thonny aplicacion de escritorio descargar en www.thonny.org
# ** Compilador : wokwi Simulador online
# ** Version : 1.0
# ** Fecha/Hora : 19-10-2025, 6:45 pm,
# **
# ** Torre de Leds utilizando concepto de Herencia
# ** y tuplas, listas ciclo for
# **
# ** Versión : 1
# ** Revisión : A
# ** Release : 0
# ** Bugs & Fixes :
# ** Date : 19/10/2025
# **
# ** By : Jorge Anzaldo
# ** contact : [email protected]
# ** twitter x : @janzaldob
# #############################################################################
# ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# : Librerias / Bibliotecas / Modulos | :
# ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
from machine import Pin #https://docs.micropython.org/en/latest/library/machine.Pin.html
import time #https://docs.micropython.org/en/latest/library/time.html
# +-------------------------------------------------------------------------------
# | V A R I A B L E S / O B J E T O S - G L O B A L E S |
# +-------------------------------------------------------------------------------
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# | Definición y Desarrollo de Clase |
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
class Led:
class TorreLeds(Led):
def __init__(self):
def prender_todos(self,tiempo=1):
def apagar_todos(self,tiempo=1):
def prender_der_izq(self,tiempo=0.1):
def prender_individual(self, indice, tiempo=0):
def apagar_individual(self, indice, tiempo=0):
def __del__(self):
print("Torre de LEDs destruida")
# Objetos Globales
torre = TorreLeds
# ===============================================================================
# || ||
# || B L O Q U E / F U N C I O N P R I N C I P A L ||
# || ||
# ===============================================================================
if __name__ == "__main__":
while True:
torre.prender_todos()
torre.apagar_todos()
torre.prender_der_izq()
torre.prender_individual(1, 2)
# ********************************************************************************
#
#
#
# R E F E R E N C I A S / C O M E N T A R I O S
#
# *********************************************************************************