Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

catch NotImplementedError when using bitbanged pins #30

Merged
merged 2 commits into from
Oct 10, 2018

Conversation

brennen
Copy link
Contributor

@brennen brennen commented Oct 10, 2018

On the Pi / CPython, I'm getting NotImplementedError here rather than ValueError:

(.env) pi@raspberrypi:~/Adafruit_CircuitPython_DotStar/examples $ python3 dotstar_simpletest.py 
Traceback (most recent call last):
  File "dotstar_simpletest.py", line 9, in <module>
    dots = dotstar.DotStar(board.D5, board.D6, 1, brightness=0.2)
  File "/home/pi/Adafruit_CircuitPython_DotStar/.env/lib/python3.5/site-packages/adafruit_dotstar.py", line 82, in __init__
    self._spi = busio.SPI(clock, MOSI=data)
  File "/home/pi/Adafruit_CircuitPython_DotStar/.env/lib/python3.5/site-packages/busio.py", line 88, in __init__
    format((clock, MOSI, MISO), spiPorts))
NotImplementedError: No Hardware SPI on (SCLK, MOSI, MISO)=(5, 6, None)
Valid SPI ports:((0, 11, 10, 9), (1, 21, 20, 19))

This pull makes the assumption that catching the ValueError is still necessary on CircuitPython.

On the Pi / CPython, I'm getting NotImplementedError here rather than ValueError.
This pull makes the assumption that ValueError is still necessary on CircuitPython.
@brennen brennen added the bug label Oct 10, 2018
@brennen brennen requested review from tannewt and kattni October 10, 2018 20:11
Copy link
Contributor

@kattni kattni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent! Thanks for testing this and making this change!

@kattni kattni merged commit 242f7ab into master Oct 10, 2018
tannewt pushed a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Oct 16, 2018
Updating https://github.com/adafruit/Adafruit_CircuitPython_DotStar to 1.4.0 from 1.3.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_DotStar#31 from kattni/example-update
  > Merge pull request adafruit/Adafruit_CircuitPython_DotStar#30 from adafruit/pi_bitbang_exception
  > Merge pull request adafruit/Adafruit_CircuitPython_DotStar#28 from siddacious/master
  > ignore the board module imports in .pylintrc

Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM303 to 1.2.1 from 1.2.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_LSM303#7 from dastels/master
  > ignore the board module imports in .pylintrc
  > Merge pull request adafruit/Adafruit_CircuitPython_LSM303#6 from kattni/example-update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants