8000 Merge pull request #118 from Zweedeend/RPi-4-patch · adafruit/Adafruit_Python_DHT@9aa6477 · GitHub
[go: up one dir, main page]

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

Commit 9aa6477

Browse files
authored
Merge pull request #118 from Zweedeend/RPi-4-patch
Include Raspberrpy Pi 4
2 parents afdb85b + f2799f8 commit 9aa6477

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Adafruit_DHT/platform_detect.py

Lines changed: 4 additions & 3 deletions
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,Raspberry Pi 3 (model B+) or not a Raspberry Pi.
83+
Raspberry Pi 2 (model B+), Raspberry Pi 3,Raspberry Pi 3 (model B+), Raspberry Pi 4
84+
or not a Raspberry Pi.
8485
"""
8586
# Check /proc/cpuinfo for the Hardware field value.
8687
# 2708 is pi 1
8788
# 2709 is pi 2
88-
# 2835 is pi 3
89+
# 2835 is pi 3 or pi 4
8990
# 2837 is pi 3b+
9091
# Anything else is not a pi.
9192
with open('/proc/cpuinfo', 'r') as infile:
@@ -103,7 +104,7 @@ def pi_version():
103104
# Pi 2
104105
return 2
105106
elif match.group(1) == 'BCM2835':
106-
# Pi 3
107+
# Pi 3 or Pi 4
107108
return 3
108109
elif match.group(1) == 'BCM2837':
109110
# Pi 3b+

0 commit comments

Comments
 (0)
0