Skip to content

Commit

Permalink
rename saturated_duty to saturated_speed
Browse files Browse the repository at this point in the history
  • Loading branch information
jmccand committed May 2, 2024
1 parent 83bee02 commit 5ee7b37
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/source/nanonav.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ class NanoBot:
"""
Interact with Arduino and peripheral hardware for movement and sensing.
:param saturated_duty: The maximum duty cycle to use for the motors. This can be increased to compensate somewhat for lower battery voltage.
:param saturated_speed: The maximum duty cycle to use for the motors. This is a percentage of max speed the motor can supply from 0-100. If you find that your NanoBot is driving too fast or not driving fast enough, try changing this value.
"""
def __init__(self, saturated_duty=22000, *args, **kwargs):
def __init__(self, saturated_speed=33, *args, **kwargs):

# turn ir sensor pin on (inactive because it's active low)
self.ir_right_sensor = Pin(28, Pin.OUT)
Expand Down Expand Up @@ -92,7 +92,7 @@ def __init__(self, saturated_duty=22000, *args, **kwargs):

# initialize motor constants
self.max_duty = 65535 # constant
self.saturated_duty = saturated_duty # choice for max speed
self.saturated_duty = saturated_duty * self.max_duty / 100 # choice for max speed
assert(0 <= self.saturated_duty <= self.max_duty)
self.turn90ticks = 120
self.turn_error = 5
Expand Down

0 comments on commit 5ee7b37

Please sign in to comment.