Skip to content

Convert _READ_CMD to bytes to work with memview (Blinka) #6

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

Merged
merged 2 commits into from
Jul 30, 2021

Conversation

caternuson
Copy link
Contributor

For #5. This is a Blinka only issue. Simple fix, just convert the list to bytes.

Tested with FT232H:

$ python3
Python 3.8.10 (default, Jun  2 2021, 10:49:15) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import board
>>> import adafruit_sgp40
>>> sgp = adafruit_sgp40.SGP40(board.I2C())
>>> sgp.raw
2
>>>  

@tannewt
Copy link
Member

tannewt commented Jul 29, 2021

If you use a byte string, b"\x00..." then you'll save more space. As is it's a list of ints that gets converted on import to a bytes.

@caternuson
Copy link
Contributor Author

Done! yah, i was being lazy :)

(tested and still works)

@LittleMatchaGirl
Copy link

I see the solutions now, I have to convert one thing to another list to bytes.... but how exactly? I am assuming its a couple lines of code, but do I need values? or is the b"\x00..." sufficient and do I have to add something else to that? Sorry, I am just a little confused and do not want to mess up, I already had to wipe my sdx and start fresh. Please and thank you!!

@ramenbytes
Copy link

@LittleMatchaGirl You don't need to do anything. Pull requests are used to propose some changes to the code in the repository, in this case caternuson has proposed a change that creates bytes instead of a list. Click on the "convert _READ_CMD to bytes" line under his top message to see the code he changed in the library. Once the pull request is approved and accepted, and you use the updated version of the library, the problem should go away without you needing to change code yourself.

@caternuson
Copy link
Contributor Author

Yep. The only action needed on your end will be to update the library - once the PR is merged and the update released. Until then, it's just a waiting game. I'll try and remember to respond in your issue thread once this all done.

@ladyada ladyada merged commit 5c1e198 into adafruit:main Jul 30, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Aug 4, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP230xx to 2.5.0 from 2.4.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_MCP230xx#41 from Red-M/master
  > Moved default branch to main
  > Moved CI to Python 3.7

Updating https://github.com/adafruit/Adafruit_CircuitPython_SCD4X to 1.1.0 from 1.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_SCD4X#2 from lesamouraipourpre/constants
  > Merge pull request adafruit/Adafruit_CircuitPython_SCD4X#4 from lesamouraipourpre/docs

Updating https://github.com/adafruit/Adafruit_CircuitPython_SGP40 to 1.2.0 from 1.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_SGP40#6 from caternuson/iss5

Updating https://github.com/adafruit/Adafruit_CircuitPython_MacroPad to 1.3.0 from 1.2.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_MacroPad#15 from kattni/rotation
  > Merge pull request adafruit/Adafruit_CircuitPython_MacroPad#14 from kattni/display-image-fix

Updating https://github.com/adafruit/Adafruit_CircuitPython_Simple_Text_Display to 1.2.0 from 1.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_Simple_Text_Display#6 from terop/fix_doc_typo
  > Merge pull request adafruit/Adafruit_CircuitPython_Simple_Text_Display#5 from lesamouraipourpre/adaptive-row-height

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Added the following libraries: Adafruit_CircuitPython_IS31FL3741
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants