Skip to content

Commit

Permalink
Merge pull request #9 from manderfeld/devboard_setLED
Browse files Browse the repository at this point in the history
Changing the line that checks if an object is type GPIO to isinstance
  • Loading branch information
mtyka committed Nov 25, 2019
2 parents 84b725f + 116bdc2 commit 141f6c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion teachable.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def __del__(self):

def setLED(self, index, state):
"""Abstracts away mix of GPIO and PWM LEDs."""
if type(self._LEDs[index]) is GPIO: self._LEDs[index].write(not state)
if isinstance(self._LEDs[index], GPIO): self._LEDs[index].write(not state)
else: self._LEDs[index].duty_cycle = 0.0 if state else 1.0

def getButtonState(self):
Expand Down

0 comments on commit 141f6c3

Please sign in to comment.