Skip to content
This repository was archived by the owner on Sep 30, 2019. It is now read-only.

Fix bugs with getPiRevision and readS16 #82

Merged
merged 4 commits into from
Jun 20, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fix getPiRevision to check for revision value 0002 or 0003 as rev 1 b…
…oards.
  • Loading branch information
tdicola committed Jun 19, 2014
commit b6bd43dfbe0830dbb2884c92f6921469d3271593
3 changes: 2 additions & 1 deletion Adafruit_I2C/Adafruit_I2C.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ def getPiRevision():
"Gets the version number of the Raspberry Pi board"
# Courtesy quick2wire-python-api
# https://github.com/quick2wire/quick2wire-python-api
# Updated revision info from: http://elinux.org/RPi_HardwareHistory#Board_Revision_History
try:
with open('/proc/cpuinfo','r') as f:
for line in f:
if line.startswith('Revision'):
return 1 if line.rstrip()[-1] in ['1','2'] else 2
return 1 if line.rstrip()[-1] in ['2','3'] else 2
except:
return 0

Expand Down