Closed
Description
Running on a Pi 3 (python 3.7.3).
import board
import adafruit_rgbled
rgb = adafruit_rgbled.RGBLED(board.D1, board.D2, board.D3)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/pi/.local/lib/python3.7/site-packages/adafruit_rgbled.py", line 110, in __init__
raise TypeError("Must provide a pin, PWMOut, or PWMChannel.")
TypeError: Must provide a pin, PWMOut, or PWMChannel.
This line does not identify pins correctly:
Adafruit_CircuitPython_RGBLED/adafruit_rgbled.py
Lines 104 to 110 in cb62700
>>> type(board.D1)
<class 'adafruit_blinka.microcontroller.bcm283x.pin.Pin'>
Is there a compatible way to actually test if it's a pin ? Just try/except it ?
In Circuitpython a pin is an instance of microcontroller.Pin (for isinstance
), but not currently in Blinka.
If we are going with strings, there's board.D1.__class__.__name__ == "Pin"
?