Skip to content
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
19 changes: 13 additions & 6 deletions simpleio.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,15 @@ def deinit(self):

class DigitalOut:
"""
Simple digital output that is valid until soft reset.
Simple digital output that is valid until reload.

:param pin microcontroller.Pin: output pin
:param value bool: default value
:param drive_mode digitalio.DriveMode: drive mode for the output
"""
def __init__(self, pin):
def __init__(self, pin, **kwargs):
self.iopin = digitalio.DigitalInOut(pin)
self.iopin.switch_to_output()
self.iopin.switch_to_output(**kwargs)

@property
def value(self):
Expand All @@ -245,11 +249,14 @@ def value(self, value):

class DigitalIn:
"""
Simple digital input that is valid until soft reset.
Simple digital input that is valid until reload.

:param pin microcontroller.Pin: input pin
:param pull digitalio.Pull: pull configuration for the input
"""
def __init__(self, pin):
def __init__(self, pin, **kwargs):
self.iopin = digitalio.DigitalInOut(pin)
self.iopin.switch_to_input()
self.iopin.switch_to_input(**kwargs)

@property
def value(self):
Expand Down