# #############################################################################
# **    Proyecto       : 211 4-Digit Display
# **    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     : 25-07-2024, 11:05 PM, 
# **    
# **            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           : 25/07/2024
# **   
# **   By             : Jorge Anzaldo    
# **   contact        : [email protected]
# **   twitter x      : @janzaldob
#  #############################################################################

# ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# :                       Librerias / Bibliotecas / Modulos                      |                            :
# ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

import machine
import random
import time
import tm1637              

# +-------------------------------------------------------------------------------
# |            V A R I A B L E S / O B J E T O S - G L O B A L E S                                     |
# +-------------------------------------------------------------------------------


display = tm1637.TM1637(clk=machine.Pin(33), dio=machine.Pin(25))

display.scroll("hola", delay=1000)
time.sleep(1)
display.show('    ')
time.sleep(1)

temp = random.randrange(10,15)


# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
# |                    Definición y Desarrollo de Funciones / Clases             |
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


# ===============================================================================
# ||                                                                            ||
# ||        P R O G R A M A / F U N C I O N    P R I N C I P A L                ||
# ||                                                                            ||
# =============================================================================== 
txt = ' '
if __name__ == '__main__':
    while True:
        '''
        temp = random.randrange(10,25)
        display.temperature(temp)
        time.sleep(5)
        '''
       
        for i in range(0,9999,100):
            display.show('    ')
            txt = str(i)
            display.show(txt)
            time.sleep(1)
        
# ********************************************************************************
#                                                                            
#                                                                            
#                                                                            
#                R E F E R E N C I A S  / C O M E N T A R I O S  
# 
#                       
#                                                                      
# *********************************************************************************
4-Digit Display