Skip to content

Commit

Permalink
Merge pull request #30 from apatt/master
Browse files Browse the repository at this point in the history
  • Loading branch information
tannewt authored May 18, 2018
2 parents 549c6e4 + a5f72b4 commit c722041
Showing 1 changed file with 13 additions and 6 deletions.
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

0 comments on commit c722041

Please sign in to comment.