MicroPython: Correct is not True usage.

Co-authored-by: ZodiusInfuser <christopher.parrott2@gmail.com>
pull/373/head
Phil Howard 2022-06-17 14:24:23 +01:00
rodzic ef1bdff2bd
commit 3cd64202fd
19 zmienionych plików z 19 dodań i 19 usunięć

Wyświetl plik

@ -30,7 +30,7 @@ led.start()
hue = 0.0
# Make rainbows until the user button is pressed
while user_sw.raw() is not True:
while not user_sw.raw():
hue += SPEED / 1000.0

Wyświetl plik

@ -40,7 +40,7 @@ led.start()
offset = 0.0
# Make waves until the user button is pressed
while user_sw.raw() is not True:
while not user_sw.raw():
offset += SPEED / 1000.0

Wyświetl plik

@ -66,7 +66,7 @@ start_value = 0.0
end_value = random.uniform(-POSITION_EXTENT, POSITION_EXTENT)
# Continually move the motor until the user button is pressed
while user_sw.raw() is not True:
while not user_sw.raw():
# Capture the state of the encoder
capture = enc.capture()

Wyświetl plik

@ -73,7 +73,7 @@ start_value = 0.0
end_value = random.uniform(-POSITION_EXTENT, POSITION_EXTENT)
# Continually move the motor until the user button is pressed
while user_sw.raw() is not True:
while not user_sw.raw():
# Capture the state of the encoder
capture = enc.capture()

Wyświetl plik

@ -71,7 +71,7 @@ update = 0
print_count = 0
# Continually move the motor until the user button is pressed
while user_sw.raw() is not True:
while not user_sw.raw():
# Capture the state of the encoder
capture = enc.capture()

Wyświetl plik

@ -64,7 +64,7 @@ update = 0
print_count = 0
# Continually move the motor until the user button is pressed
while user_sw.raw() is not True:
while not user_sw.raw():
# Capture the state of the encoder
capture = enc.capture()

Wyświetl plik

@ -78,7 +78,7 @@ end_value = 270.0
captures = [None] * motor2040.NUM_MOTORS
# Continually move the motor until the user button is pressed
while user_sw.raw() is not True:
while not user_sw.raw():
# Capture the state of all the encoders
for i in range(motor2040.NUM_MOTORS):

Wyświetl plik

@ -102,7 +102,7 @@ sequence = 0
captures = [None] * motor2040.NUM_MOTORS
# Continually move the motor until the user button is pressed
while user_sw.raw() is not True:
while not user_sw.raw():
# Capture the state of all the encoders
for i in range(motor2040.NUM_MOTORS):

Wyświetl plik

@ -92,7 +92,7 @@ detent_change(0)
# Continually move the motor until the user button is pressed
while user_sw.raw() is not True:
while not user_sw.raw():
# Capture the state of the encoder
capture = enc.capture()

Wyświetl plik

@ -34,7 +34,7 @@ encoders = [Encoder(0, i, ENCODER_PINS[i], counts_per_rev=COUNTS_PER_REV, count_
user_sw = Button(motor2040.USER_SW)
# Read the encoders until the user button is pressed
while user_sw.raw() is not True:
while not user_sw.raw():
# Print out the angle of each encoder
for i in range(NUM_ENCODERS):

Wyświetl plik

@ -33,7 +33,7 @@ user_sw = Button(motor2040.USER_SW)
# Read sensors until the user button is pressed
while user_sw.raw() is not True:
while not user_sw.raw():
# Read each sensor in turn and print its voltage
for i in range(len(sensor_addrs)):

Wyświetl plik

@ -66,7 +66,7 @@ start_value = 0.0
end_value = random.uniform(-VELOCITY_EXTENT, VELOCITY_EXTENT)
# Continually move the motor until the user button is pressed
while user_sw.raw() is not True:
while not user_sw.raw():
# Capture the state of the encoder
capture = enc.capture()

Wyświetl plik

@ -64,7 +64,7 @@ update = 0
print_count = 0
# Continually move the motor until the user button is pressed
while user_sw.raw() is not True:
while not user_sw.raw():
# Capture the state of the encoder
capture = enc.capture()

Wyświetl plik

@ -52,7 +52,7 @@ led_bar.start()
servos.enable_all()
# Read sensors until the user button is pressed
while user_sw.raw() is not True:
while not user_sw.raw():
# Select the current sense
mux.select(servo2040.CURRENT_SENSE_ADDR)

Wyświetl plik

@ -30,7 +30,7 @@ led_bar.start()
offset = 0.0
# Make rainbows until the user button is pressed
while user_sw.raw() is not True:
while not user_sw.raw():
offset += SPEED / 1000.0

Wyświetl plik

@ -30,7 +30,7 @@ user_sw = Button(servo2040.USER_SW)
# Read sensors until the user button is pressed
while user_sw.raw() is not True:
while not user_sw.raw():
# Read each sensor in turn and print its voltage
for i in range(len(sensor_addrs)):

Wyświetl plik

@ -41,7 +41,7 @@ led_bar.start()
# Read sensors until the user button is pressed
while user_sw.raw() is not True:
while not user_sw.raw():
# Read each sensor in turn and print its voltage
for i in range(len(sensor_addrs)):

Wyświetl plik

@ -41,7 +41,7 @@ led_bar.start()
offset = 0.0
# Make waves until the user button is pressed
while user_sw.raw() is not True:
while not user_sw.raw():
offset += SPEED / 1000.0

Wyświetl plik

@ -31,7 +31,7 @@ user_sw = Button(servo2040.USER_SW)
update = 0
# Continually move the servo until the user button is pressed
while user_sw.raw() is not True:
while not user_sw.raw():
# Calculate how far along this movement to be
percent_along = update / UPDATES_PER_MOVE