import threading # Dedicated lock for I2C bus access (used by GrovePi sensors) grove_lock = threading.Lock() # Dedicated lock for UART/Serial port access serial_lock = threading.Lock()