MCPcopy Create free account
hub / github.com/DexterInd/GoPiGo3 / cleanup

Function cleanup

Software/Scratch/GoPiGo3Scratch.py:41–52  ·  view source on GitHub ↗

Stop BrickPi3 and print out error msg if I can figure out how to differentiate between normal exit and crash then I'll consider having a popup window here.

()

Source from the content-addressed store, hash-verified

39
40@atexit.register
41def cleanup():
42 '''
43 Stop BrickPi3 and print out error msg
44 if I can figure out how to differentiate between normal exit and crash
45 then I'll consider having a popup window here.
46 '''
47 try:
48 gpg.reset_all()
49 # we want the gopigo3 to stop if gopigo3Scratch.py crashes
50 except:
51 pass
52 logger.info ("Scratch Interpreter closed")
53
54def detect_distance_sensor():
55 '''

Callers

nothing calls this directly

Calls 1

reset_allMethod · 0.45

Tested by

no test coverage detected