Permalink
Browse files

Merge pull request #12 from jn0/patch-1

Initial line #109: return prevents file closing.
  • Loading branch information...
2 parents f7ee3a9 + 5ec2739 commit a8755059910e80cad5e141dc8e84c0a9123b5f2f @mrichardson23 committed May 7, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 mrbbio.py
View
@@ -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;

0 comments on commit a875505

Please sign in to comment.