Does GPIO.cleanup() reset all the pins to original state?
I see many Python scripts that exits with GPIO.cleanup(). But what if we do have Relays or Diodes connected to some of pins and we do not wish to reset those pins?
I found article that says:
RPi.GPIO provides a built-in function GPIO.cleanup() to clean up all the ports you’ve used. But be very clear what this does. It only affects any ports you have set in the current program. It resets any ports you have used in this program back to input mode.
But, how Raspberry GPIO knows that it can reset just pins in some Python script that we have used? Is this correct what I read about? Will My Relays and Diodes still having same state (on or off) untill some py script set GPIO.cleanup() because I have Button connected also and pin is set to INPUT?
Thanx,
Faramon