Update to import options and examples #79
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
THIS IS A BREAKING CHANGE FOR THE UPDATED EXAMPLES. ALL PREVIOUS CODE WILL CONTINUE TO WORK AS-IS.
REQUIRES LATEST CHANGES TO CIRCUITPYTHON TO USE ON CIRCUIT PLAYGROUND EXPRESS. 5.x support for using this updated library on CPX requires this PR: adafruit/circuitpython#2393 and there is a forthcoming PR for 4.x of the same nature that will be required to use the updated lib.
As this library is frozen into the CPX build, we will be doing a new release of 4.x once all the fixes are in. For now, this update doesn't affect the current 4.1.0 because the frozen library has not been updated yet.
You can now
from adafruit_circuitplayground import cp
and it will detect whether you are using a Circuit Playground Express or a Circuit Playground Bluefruit and import the appropriate library.All examples have been updated to reflect this. THE EXAMPLES IN THIS REPO WILL NOW ONLY WORK WITH THE LATEST VERSION OF THE LIBRARY.
Both
from adafruit_circuitplayground.express import cpx
andfrom adafruit_circuitplayground.bluefruit import cpb
still work, so all previous example code will continue to work with the updated library.Updated doc strings to reflect changes - all references to CPX are now "Circuit Playground" to include the added Bluefruit support.
Added exception handling to the IR examples as the Bluefruit does not support IR.
Tested every example on Circuit Playground Bluefruit, Circuit Playground Express 5.x test build, and Circuit Playground Express 4.x test build.