You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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".
@Tob1as Hello are you still need to solve this, I think this is maybe this is more a question than an issue. You could ask in the discord channel for Adafruit. However:
Yes you need to pass the object in this case, meaning board.D4. I do not use docker but normally when I need to pass arguments, objects or other things between libraries I used a dictionary, something like this
import board
boardspins = {'D0': board.D0, 'D1': board.D1, 'D2': board.D2, 'D3': board.D3, 'D4': board.D4, 'D5': board.D5,
'D6': board.D6, 'D7': board.D7, 'D8': board.D8, 'D9': board.D9, 'D10': board.D10,
'D13': board.D13}
pin4 = boardspins['D4']
and then you will call them using dhtDevice = adafruit_dht.DHT22(pin4)
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:
But now I have problem to replace the number 4 in this line:
This:
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.)
The text was updated successfully, but these errors were encountered: