import tclab import numpy as np tclab_hardware = False if tclab_hardware: mlab = tclab.TCLab # Physical hardware else: speedup = 100 # Emulator (digital twin) speed-up mlab = tclab.setup(connected=False, speedup=speedup) n = 500 tm = np.linspace(0,2*n,n+1) # Connect to TCLab with mlab() as lab: # set heater values lab.Q1(70) lab.Q2(20) for t in tclab.clock(tm[-1]+1, 2): print('Time: ' + str(t) + \ ' T1: ' + str(round(lab.T1,2)) + \ ' T2: ' + str(round(lab.T2,2)))