Skip to content

Commit a554d72

Browse files
committed
Added exception for trying to bitbang in circuitpython
1 parent 5ea7589 commit a554d72

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

adafruit_dht.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
import array
3232
import time
33+
from os import uname
3334
from digitalio import DigitalInOut, Pull, Direction
3435

3536
_USE_PULSEIO = False
@@ -64,6 +65,8 @@ def __init__(self, dht11, pin, trig_wait, use_pulseio):
6465
self._humidity = None
6566
self._temperature = None
6667
self._use_pulseio = use_pulseio
68+
if "Linux" not in uname() and not self._use_pulseio:
69+
raise Exception("Bitbanging is not supported when using CircuitPython.")
6770
# We don't use a context because linux-based systems are sluggish
6871
# and we're better off having a running process
6972
if self._use_pulseio:

0 commit comments

Comments
 (0)