Add Service and MqttSubscriber classes
- Create utils dir and move utils.py there
This commit is contained in:
12
motor_passo/utils/utils.py
Normal file
12
motor_passo/utils/utils.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import signal
|
||||
|
||||
|
||||
def _cleanup(*args, **kwargs):
|
||||
import sys
|
||||
import RPi.GPIO as gpio
|
||||
gpio.cleanup()
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
def setup_cleanup():
|
||||
signal.signal(signal.SIGINT, _cleanup)
|
||||
Reference in New Issue
Block a user