kopia lustrzana https://github.com/pimoroni/pimoroni-pico
MicroPython: Correct is not True usage.
Co-authored-by: ZodiusInfuser <christopher.parrott2@gmail.com>pull/373/head
rodzic
ef1bdff2bd
commit
3cd64202fd
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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)):
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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)):
|
||||
|
|
|
@ -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)):
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Ładowanie…
Reference in New Issue