Skip to content

Commit

Permalink
Merge branch 'Rotule666-digital-output-pin-initialization'
Browse files Browse the repository at this point in the history
Thanks @Rotule666 for spotting this quite lax coding there.
I've further improved it by adding a proper default behaviour
in case the function letter is unknown or misspelt.
  • Loading branch information
berndporr committed Feb 23, 2024
2 parents d0a41a3 + 48f97e2 commit 952fdd3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyfirmata2/pyfirmata2.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,11 @@ def get_pin(self, pin_def):
pin.mode = SERVO
elif bits[2] == 'u':
pin.mode = INPUT_PULLUP
elif bits[2] != 'o':
elif bits[2] == 'i':
pin.mode = INPUT
elif bits[2] == 'o':
pin.mode = OUTPUT
else:
pin.mode = INPUT
else:
pin.enable_reporting()
Expand Down

0 comments on commit 952fdd3

Please sign in to comment.