from datetime import datetime import control_functions as cf import board from adafruit_hcsr04 import HCSR04 as hcsr04 # Ultrasound sensor try: with open("pid-balancer_" + "time_file.txt", "w") as time_file: time_file.write(datetime.strftime(datetime.now(), '%Y%m%d%H%M%S.%f')[:-3]) while True: cf.read_distance_sensor() except RuntimeError: print()