TM1638 display work with delay
Posted: Wed Mar 17, 2021 2:40 pm
Hello everybody
I'm new on this forum.
I tried to display the temperature in the DS18X20 sensor on the TM1638 display.
The display is very slow, each digit is active for about 2 s.
I use library from https://github.com/mcauser/micropython-tm1638
Code:
Note: In Thonny shell refresh time for temperature is ok
I'm new on this forum.
I tried to display the temperature in the DS18X20 sensor on the TM1638 display.
The display is very slow, each digit is active for about 2 s.
I use library from https://github.com/mcauser/micropython-tm1638
Code:
Code: Select all
import machine, onewire, ds18x20, time
import tm1638
from machine import Pin
ds_pin = machine.Pin(16)
tm = tm1638.TM1638(stb=Pin(2), clk=Pin(3), dio=Pin(6))
ds_sensor = ds18x20.DS18X20(onewire.OneWire(ds_pin))
roms = ds_sensor.scan()
print('Found a ds18x20 device:',roms)
while True:
ds_sensor.convert_temp()
time.sleep_ms(750)
for rom in roms:
print(ds_sensor.read_temp(rom))
t=str(ds_sensor.read_temp(rom))
tm.show(t)
#time.sleep(2)