Skip to content

Commit d46b6b4

Browse files
committed
Add a warning about start/stop program which resets sensors and motors
1 parent 6890ca4 commit d46b6b4

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

nxt/brick.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,9 @@ def start_program(self, name: str) -> None:
356356
"""Start a program on the brick.
357357
358358
:param name: Program file name (example: ``"myprogram.rxe"``).
359+
360+
.. warning:: When starting or stopping a program, the NXT firmware resets every
361+
sensors and motors.
359362
"""
360363
tgram = Telegram(Opcode.DIRECT_START_PROGRAM)
361364
tgram.add_filename(name)
@@ -365,6 +368,9 @@ def stop_program(self) -> None:
365368
"""Stop the running program on the brick.
366369
367370
:raises nxt.error.NoActiveProgramError: When no program is running.
371+
372+
.. warning:: When starting or stopping a program, the NXT firmware resets every
373+
sensors and motors.
368374
"""
369375
tgram = Telegram(Opcode.DIRECT_STOP_PROGRAM)
370376
self._cmd(tgram)

nxt/motcont.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ def start(self, version: int = 22) -> None:
196196
It needs to already be present on the brick's flash and named
197197
``MotorControlXX.rxe``, where `XX` is the version number passed as the version
198198
argument.
199+
200+
.. warning:: When starting or stopping a program, the NXT firmware resets every
201+
sensors and motors.
199202
"""
200203
try:
201204
self._brick.stop_program()
@@ -209,5 +212,8 @@ def stop(self) -> None:
209212
"""Stop the MotorControl program.
210213
211214
All this actually does is to stop the currently running program.
215+
216+
.. warning:: When starting or stopping a program, the NXT firmware resets every
217+
sensors and motors.
212218
"""
213219
self._brick.stop_program()

0 commit comments

Comments
 (0)