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

Commit b6bd43d

Browse files
committed
Fix getPiRevision to check for revision value 0002 or 0003 as rev 1 boards.
1 parent fa0a792 commit b6bd43d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Adafruit_I2C/Adafruit_I2C.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ def getPiRevision():
1313
"Gets the version number of the Raspberry Pi board"
1414
# Courtesy quick2wire-python-api
1515
# https://github.com/quick2wire/quick2wire-python-api
16+
# Updated revision info from: http://elinux.org/RPi_HardwareHistory#Board_Revision_History
1617
try:
1718
with open('/proc/cpuinfo','r') as f:
1819
for line in f:
1920
if line.startswith('Revision'):
20-
return 1 if line.rstrip()[-1] in ['1','2'] else 2
21+
return 1 if line.rstrip()[-1] in ['2','3'] else 2
2122
except:
2223
return 0
2324

0 commit comments

Comments
 (0)