# Dictionary to hold the last known values of the registers
local_cache = {}
def update_register(register, new_value):
# Check if the register value has changed
if register not in local_cache or local_cache[register] != new_value:
# Update the hardware register if the value has changed
write_to_hardware_register(register, new_value)
# Update the local cache with the new value
local_cache[register] = new_value
Return to General discussion about the UCCNC software
Users browsing this forum: Elitefloatsuk and 10 guests