Posts: 9
Joined: Sun May 26, 2013 10:38 pm

Leave LED on with gpiozero

Sat May 23, 2020 8:57 pm


I have a cron job that periodically runs and changes the state of an LED. I am trying to figure out how to do that with the gpiozero library - it seems to me like after you turn LED.on(), once the program exits it does its cleanup and as part of that it turns off the LED. Any idea how to keep the LED on after the program exits? Or is there a way to disable the cleanup if that's the only thing that it does?

Btw, I know I can achieve that with the GPIO library but at this point i am using gpiozero at a few places and I'd have to re-write it all to use GPIO which isn't great...


ref: ... t.html#led

User avatar
Posts: 38447
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Leave LED on with gpiozero

Sat May 23, 2020 9:24 pm

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

I'll do your homework for you for a suitable fee.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Python”