Aug-31-2020, 11:46 PM
I have a program that monitors a scale and uses LEDs to indicate the weight of the object on the scale. At the start of the script, it gets all the prerequisites and establishes a tare. I then get a print("The scale is ready...") and a quick flash of an LED. I want to run this headless, so that I can rely only on the quick flash of the LED to tell me it is ready. Without the GUI, I have no way of stopping the program if it is already running, then restarting it.
So what I want is to have a program run on boot, waiting for the button input. Using gpiozero, I would like to have the button kill this scale program (if it is running) and restart it, or simply start it if it isn't running. In the event of a power failure or other reboot event, I would simply observe that the LEDs are not on, then I could just remove the item from the scale, press the button, then put it back on. Then the LEDs would indicate the proper level.
Sounds simple to me, just don't know where to start.
So what I want is to have a program run on boot, waiting for the button input. Using gpiozero, I would like to have the button kill this scale program (if it is running) and restart it, or simply start it if it isn't running. In the event of a power failure or other reboot event, I would simply observe that the LEDs are not on, then I could just remove the item from the scale, press the button, then put it back on. Then the LEDs would indicate the proper level.
Sounds simple to me, just don't know where to start.