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

Commit 7584026

Browse files
authored
add Pi 3b+ support
add support to Pi 3b+,which use 'BCM2837',build succsess
1 parent 18846de commit 7584026

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Adafruit_DHT/platform_detect.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,13 @@ def pi_revision():
8080
def pi_version():
8181
"""Detect the version of the Raspberry Pi. Returns either 1, 2, 3 or
8282
None depending on if it's a Raspberry Pi 1 (model A, B, A+, B+),
83-
Raspberry Pi 2 (model B+), Raspberry Pi 3 or not a Raspberry Pi.
83+
Raspberry Pi 2 (model B+), Raspberry Pi 3,Raspberry Pi 3 (model B+) or not a Raspberry Pi.
8484
"""
8585
# Check /proc/cpuinfo for the Hardware field value.
8686
# 2708 is pi 1
8787
# 2709 is pi 2
8888
# 2835 is pi 3
89+
# 2837 is pi 3b+
8990
# Anything else is not a pi.
9091
with open('/proc/cpuinfo', 'r') as infile:
9192
cpuinfo = infile.read()
@@ -104,6 +105,9 @@ def pi_version():
104105
elif match.group(1) == 'BCM2835':
105106
# Pi 3
106107
return 3
108+
elif match.group(1) == 'BCM2837':
109+
# Pi 3b+
110+
return 3
107111
else:
108112
# Something else, not a pi.
109113
return None

0 commit comments

Comments
 (0)