import _thread
import time
def sense_forever():
while True:
print('reading sensor')
time.sleep(5)
try:
_thread.start_new_thread(sense_forever, ()) # Iniciar en la derecha en un nuevo hilo
except:
print("Error: no se pudo iniciar el hilo")