I suspect your problem is related to using gpiozero' to drive the LEDs.
From what I remember gpiozero resets all used GPIO to their default state when your program exits.
It could also be the GPIO.cleanup() but I don't see the function it's in ever being called.
Assuming I'm correct your options seem to include:
From what I remember gpiozero resets all used GPIO to their default state when your program exits.
It could also be the GPIO.cleanup() but I don't see the function it's in ever being called.
Assuming I'm correct your options seem to include:
- Using something other than gpiozero to drive the LEDs that doesn't do this.
- Launching your program once (e.g. under a systemd service) with your measure_weight() function wrapped in an infinite loop with a suitable delay (if you want precise timing you'll need to calculate the interval each iteration).
Statistics: Posted by thagrol — Wed Mar 12, 2025 4:47 pm