Skip to content

Change argument name to *_dio #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions adafruit_dymoscale.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class DYMOScale:
def __init__(
self,
data_pin: microcontroller.Pin,
units_pin: DigitalInOut,
units_dio: DigitalInOut,
timeout: float = 1.0,
) -> None:
"""Sets up a DYMO postal scale.
Expand All @@ -63,7 +63,7 @@ def __init__(
"""
self.timeout = timeout
# set up the toggle pin
self.units_pin = units_pin
self.units_dio = units_dio
# set up the dymo data pin
self.dymo = PulseIn(data_pin, maxlen=96, idle_state=True)

Expand All @@ -86,7 +86,7 @@ def toggle_unit_button(self, switch_units: bool = False) -> None:
else: # toggle and preserve current unit state
toggle_amt = 4
while toggle_times < toggle_amt:
self.units_pin.value ^= 1
self.units_dio.value ^= 1
time.sleep(2)
toggle_times += 1

Expand Down