Skip to content

Commit

Permalink
Merge pull request #10 from boukevanderbijl/patch-1
Browse files Browse the repository at this point in the history
Use constants to check status and direction
  • Loading branch information
mrichardson23 committed Mar 15, 2012
2 parents 81b068f + c2769a2 commit b780146
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mrbbio.py
Expand Up @@ -63,7 +63,7 @@ def pinMode(pin, direction):
fw.close()
fileName = "/sys/class/gpio/gpio%d/direction" % (digitalPinDef[pin])
fw = file(fileName, "w")
if direction == "INPUT":
if direction == INPUT:
fw.write("in")
else:
fw.write("out")
Expand All @@ -78,9 +78,9 @@ def digitalWrite(pin, status):
if pin in digitalPinDef:
fileName = "/sys/class/gpio/gpio%d/value" % (digitalPinDef[pin])
fw = file(fileName, "w")
if status == "HIGH":
if status == HIGH:
fw.write("1")
if status == "LOW":
if status == LOW:
fw.write("0")
fw.close()
else:
Expand Down

0 comments on commit b780146

Please sign in to comment.