From bd50b4a4cee1be495d3fe5c07796791955f78100 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Tue, 19 Jul 2022 19:06:02 +0200 Subject: [PATCH] Move stop motor example out of tutorial directory --- examples/{tutorial => }/stop_turning_motor.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) rename examples/{tutorial => }/stop_turning_motor.py (76%) diff --git a/examples/tutorial/stop_turning_motor.py b/examples/stop_turning_motor.py similarity index 76% rename from examples/tutorial/stop_turning_motor.py rename to examples/stop_turning_motor.py index 9e23299..6cf0e53 100644 --- a/examples/tutorial/stop_turning_motor.py +++ b/examples/stop_turning_motor.py @@ -1,4 +1,5 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 +"""NXT-Python example to use thread to stop a motor.""" import threading import time @@ -7,9 +8,9 @@ with nxt.locator.find() as b: # Get the motor connected to the port A. - mymotor: nxt.motor.BaseMotor = b.get_motor(nxt.motor.Port.A) + mymotor = b.get_motor(nxt.motor.Port.A) - stop_motor = False # controls wether the motor should stop turning + stop_motor = False # controls whether the motor should stop turning # create thread that turns the motor t = threading.Thread(