From e336c071bfd36db9c2824136d93473ba0271de3e Mon Sep 17 00:00:00 2001 From: Jordan-Fielding <107819004+Jordan-Fielding@users.noreply.github.com> Date: Thu, 7 Jul 2022 10:59:04 +1000 Subject: [PATCH] Update main.py --- main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.py b/main.py index f381744..0eb0153 100644 --- a/main.py +++ b/main.py @@ -56,7 +56,12 @@ def bugmotion(): time.sleep(2) print("\nSystem Ready!") +def exit_handler(): + print('Program Shutting Down!') + GPIO.output(22, 0) # turns off LED + bugmotion() #Starts Program +atexit.register(exit_handler)