Skip to content

Commit 4887dea

Browse files
committed
Send init frame to controller before shutdowning App
1 parent 2e65aad commit 4887dea

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

neopia/neosoco.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,13 @@ def dispose(self):
252252
Neosoco._robots[self.get_index()] = None
253253
self._neobot._dispose()
254254
Runner.unregister_robot(self)
255+
# Lastly send init packe to stop all action in the controller
256+
self.write(Neosoco.OUTPUT_1, 0)
257+
self.write(Neosoco.OUTPUT_2, 0)
258+
self.write(Neosoco.OUTPUT_3, 0)
259+
self.write(Neosoco.LEFT_MOTOR, 0)
260+
self.write(Neosoco.RIGHT_MOTOR, 0)
261+
self.write(Neosoco.NOTE, 0)
255262

256263
def reset(self):
257264
self._bpm = 60

0 commit comments

Comments
 (0)