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

add Pi 3b+ support #104

Merged
merged 1 commit into from Nov 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion Adafruit_DHT/platform_detect.py
Expand Up @@ -80,12 +80,13 @@ def pi_revision():
def pi_version():
"""Detect the version of the Raspberry Pi. Returns either 1, 2, 3 or
None depending on if it's a Raspberry Pi 1 (model A, B, A+, B+),
Raspberry Pi 2 (model B+), Raspberry Pi 3 or not a Raspberry Pi.
Raspberry Pi 2 (model B+), Raspberry Pi 3,Raspberry Pi 3 (model B+) or not a Raspberry Pi.
"""
# Check /proc/cpuinfo for the Hardware field value.
# 2708 is pi 1
# 2709 is pi 2
# 2835 is pi 3
# 2837 is pi 3b+
# Anything else is not a pi.
with open('/proc/cpuinfo', 'r') as infile:
cpuinfo = infile.read()
Expand All @@ -104,6 +105,9 @@ def pi_version():
elif match.group(1) == 'BCM2835':
# Pi 3
return 3
elif match.group(1) == 'BCM2837':
# Pi 3b+
return 3
else:
# Something else, not a pi.
return None