# #############################################################################
# ** Proyecto : 301 Programacion Concurrente
# ** 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 : 06-09-2024, 1:10 AM,
# **
# ** E N P R O C E S O - T R A B A J A N D O
# **
# ** Versión : 1
# ** Revisión : A
# ** Release : 0
# ** Bugs & Fixes :
# ** Date : 06/09/2024
# **
# ** By : Jorge Anzaldo
# ** contact : [email protected]
# ** twitter x : @janzaldob
# #############################################################################
# ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# : Librerias / Bibliotecas / Modulos | :
# ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
import _thread
from ledClass import Led
# +-------------------------------------------------------------------------------
# | V A R I A B L E S / O B J E T O S - G L O B A L E S |
# +-------------------------------------------------------------------------------
ledI = Led()
led1 = Led(4)
rgb1 = Led(16,17,18)
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# | Definición y Desarrollo de Funciones / Clases |
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
def hilo1():
while True:
# print("Trabajando con hilo 1")
led1.time(2,0.5)
led1.toggle()
def hilo2():
ledI.time(1,0.1)
while True:
for i in range(9):
# print("Trabajando con hilo 2")
rgb1.color(i)
# ===============================================================================
# || ||
# || P R O G R A M A / F U N C I O N P R I N C I P A L ||
# || ||
# ===============================================================================
if __name__ == '__main__':
_thread.start_new_thread(hilo1, ())
_thread.start_new_thread(hilo2, ())
while True:
ledI.time(0.2,0.2)
ledI.toggle()
# print("Led Interno")