Skip to content

Commit

Permalink
Merge pull request #12 from jn0/patch-1
Browse files Browse the repository at this point in the history
Initial line #109: return prevents file closing.
  • Loading branch information
mrichardson23 committed May 7, 2012
2 parents f7ee3a9 + 5ec2739 commit a875505
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mrbbio.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ def analogRead(pin):
if pin in analogPinDef:
fileName = "/sys/devices/platform/tsc/" + (analogPinDef[pin])
fw = file(fileName, "r")
return fw.read()
data = fw.read()
fw.close()
return data
else:
print "analogRead error: Pin " + pin + " is not defined as an analog in pin in the pin definition."
return -1;
Expand Down

0 comments on commit a875505

Please sign in to comment.