Closed
Description
Hello,
i use the example file dht_simpletest.py and replace D18 with D4 for use on Raspberry Pi 3.
But now I would like to set the pin over an enviroment variable. I add this to the script:
import os
DHT_DATA_PIN = int(os.environ.get('GPIO_PIN_DHT22', 4))
But now I have problem to replace the number 4 in this line:
dhtDevice = adafruit_dht.DHT22(board.D4)
This:
dhtDevice = adafruit_dht.DHT22(DHT_DATA_PIN)
# or
dhtDevice = adafruit_dht.DHT22(4)
works local on Raspberry, but not in Docker Container... error: self._pin = Pin(pin.id) AttributeError: 'int' object has no attribute 'id'
. So i think i must use it with "board".
Can anyone help or have an idea? :-)
(My complete Code if it helps.)
Metadata
Metadata
Assignees
Labels
No labels