Skip to content

Commit

Permalink
Comment tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
ZodiusInfuser committed Nov 10, 2023
1 parent 7470025 commit 5655dea
Show file tree
Hide file tree
Showing 24 changed files with 28 additions and 25 deletions.
2 changes: 1 addition & 1 deletion examples/modules/bench_power/controllable_power.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
current_time = ticks_add(current_time, int(1000 / UPDATES))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates taking a non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

finally:
Expand Down
2 changes: 1 addition & 1 deletion examples/modules/bench_power/multiple_powers.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def voltage_from_index(index, offset=0.0):
current_time = ticks_add(current_time, int(1000 / UPDATES))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates takinga non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

finally:
Expand Down
2 changes: 1 addition & 1 deletion examples/modules/big_motor/all_motors_no_encoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def speed_from_index(index, offset=0.0):
current_time = ticks_add(current_time, int(1000 / UPDATES))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates takinga non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

finally:
Expand Down
2 changes: 1 addition & 1 deletion examples/modules/big_motor/multiple_motors.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def pio_and_sm_generator():
current_time = ticks_add(current_time, int(1000 / UPDATES))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates takinga non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

finally:
Expand Down
2 changes: 1 addition & 1 deletion examples/modules/big_motor/position_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
current_time = ticks_add(current_time, int(1000 * UPDATE_RATE))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates takinga non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

module.motor.disable() # Disable the motor
Expand Down
2 changes: 1 addition & 1 deletion examples/modules/big_motor/position_on_velocity_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
current_time = ticks_add(current_time, int(1000 * UPDATE_RATE))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates takinga non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

module.motor.disable() # Disable the motor
Expand Down
2 changes: 1 addition & 1 deletion examples/modules/big_motor/single_motor.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
current_time = ticks_add(current_time, int(1000 / UPDATES))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates takinga non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

finally:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
current_time = ticks_add(current_time, int(1000 * UPDATE_RATE))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates takinga non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

module.motor.disable() # Disable the motor
Expand Down
2 changes: 1 addition & 1 deletion examples/modules/big_motor/tuning/position_tuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
current_time = ticks_add(current_time, int(1000 * UPDATE_RATE))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates takinga non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

module.motor.disable() # Disable the motor
Expand Down
2 changes: 1 addition & 1 deletion examples/modules/big_motor/tuning/velocity_tuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
current_time = ticks_add(current_time, int(1000 * UPDATE_RATE))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates takinga non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

module.motor.disable() # Disable the motor
Expand Down
2 changes: 1 addition & 1 deletion examples/modules/big_motor/velocity_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
current_time = ticks_add(current_time, int(1000 * UPDATE_RATE))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates takinga non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

module.motor.disable() # Disable the motor
Expand Down
2 changes: 1 addition & 1 deletion examples/modules/dual_motor/all_motors.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def speed_from_index(index, offset=0.0):
current_time = ticks_add(current_time, int(1000 / UPDATES))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates takinga non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

finally:
Expand Down
2 changes: 1 addition & 1 deletion examples/modules/dual_motor/multiple_motors.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def speed_from_index(index, offset=0.0):
current_time = ticks_add(current_time, int(1000 / UPDATES))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates takinga non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

finally:
Expand Down
2 changes: 1 addition & 1 deletion examples/modules/dual_motor/two_motors.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def speed_from_index(index, offset=0.0):
current_time = ticks_add(current_time, int(1000 / UPDATES))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates takinga non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

finally:
Expand Down
2 changes: 1 addition & 1 deletion examples/modules/dual_output/multiple_outputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def state_from_index(index, offset=0.0):
current_time = ticks_add(current_time, int(1000 / UPDATES))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates takinga non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

finally:
Expand Down
2 changes: 1 addition & 1 deletion examples/modules/led_strip/multiple_strips.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def pio_and_sm_generator():
current_time = ticks_add(current_time, int(SLEEP * 1000))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates takinga non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

finally:
Expand Down
2 changes: 1 addition & 1 deletion examples/modules/led_strip/single_strip.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def update_rainbow(strip, offset):
current_time = ticks_add(current_time, int(SLEEP * 1000))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates takinga non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

finally:
Expand Down
2 changes: 1 addition & 1 deletion examples/modules/quad_servo/all_servos.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def angle_from_index(index, offset=0.0):
current_time = ticks_add(current_time, int(1000 / UPDATES))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates takinga non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

finally:
Expand Down
2 changes: 1 addition & 1 deletion examples/modules/quad_servo/four_servos.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def angle_from_index(index, offset=0.0):
current_time = ticks_add(current_time, int(1000 / UPDATES))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates takinga non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

finally:
Expand Down
2 changes: 1 addition & 1 deletion examples/modules/quad_servo/multiple_servos.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def angle_from_index(index, offset=0.0):
current_time = ticks_add(current_time, int(1000 / UPDATES))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates takinga non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

finally:
Expand Down
2 changes: 1 addition & 1 deletion examples/modules/serial_servo/all_servos.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def angle_from_index(index, offset=0.0):
current_time = ticks_add(current_time, int(1000 / UPDATES))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates takinga non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

finally:
Expand Down
5 changes: 3 additions & 2 deletions examples/modules/serial_servo/drive_servo.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
SERVO_ID = 1 # The ID of the servo to control
VOLTAGE_LIMIT = 8.4 # The voltage to not exceed, to protect the servos
SPEED = 0.5 # The speed (between -1.0 and 1.0) the servo will drive at when button 'A' is pressed
POWER_ON_DELAY = 1.0 # The time to sleep after turning on the power, for serial servos to power on
SLEEP = 0.1 # The time to sleep between each update

# Variables
Expand All @@ -41,7 +42,7 @@ def button_newly_pressed(btn):
yukon.verify_and_initialise() # Verify that a SerialServoModule is attached to Yukon, and initialise it
yukon.enable_main_output() # Turn on power to the module slots

yukon.monitored_sleep(1) # Wait for serial servos to power up
yukon.monitored_sleep(POWER_ON_DELAY) # Wait for serial servos to power up

# Create an LXServo object to interact with the servo,
# giving it access to the module's UART and Duplexer
Expand Down Expand Up @@ -73,7 +74,7 @@ def button_newly_pressed(btn):
current_time = ticks_add(current_time, int(SLEEP * 1000))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates takinga non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

finally:
Expand Down
5 changes: 3 additions & 2 deletions examples/modules/serial_servo/move_servo.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
ANGLE_A = -45 # The angle (in degrees) the servo will move to when button 'A' is pressed
ANGLE_B = 45 # The angle (in degrees) the servo will move to when button 'B' is pressed
MOVEMENT_DURATION = 1.0 # The time (in seconds) the servo will perform the movements over
POWER_ON_DELAY = 1.0 # The time to sleep after turning on the power, for serial servos to power on
SLEEP = 0.1 # The time to sleep between each update

# Variables
Expand All @@ -43,7 +44,7 @@ def button_newly_pressed(btn):
yukon.verify_and_initialise() # Verify that a SerialServoModule is attached to Yukon, and initialise it
yukon.enable_main_output() # Turn on power to the module slots

yukon.monitored_sleep(1) # Wait for serial servos to power up
yukon.monitored_sleep(POWER_ON_DELAY) # Wait for serial servos to power up

# Create an LXServo object to interact with the servo,
# giving it access to the module's UART and Duplexer
Expand Down Expand Up @@ -75,7 +76,7 @@ def button_newly_pressed(btn):
current_time = ticks_add(current_time, int(SLEEP * 1000))

# Monitor sensors until the current time is reached, recording the min, max, and average for each
# This approach accounts for the updating of the rainbows taking a non-zero amount of time to complete
# This approach accounts for the updates takinga non-zero amount of time to complete
yukon.monitor_until_ms(current_time)

finally:
Expand Down
1 change: 1 addition & 0 deletions tools/load_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# Variables
yukon = Yukon(logging_level=LOG_DEBUG) # Create a Yukon object with the logging level set to debug

# Wrap the code in a try block, to catch any exceptions (including KeyboardInterrupt)
try:
# Perform the usual verify checks, but allow for unregistered and undetected modules, as well as no modules
yukon.verify_and_initialise(allow_unregistered=True, allow_undetected=True, allow_no_modules=True)
Expand Down

0 comments on commit 5655dea

Please sign in to comment.