Skip to content

example needs updating for CP 7.x #14

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

Closed
jepler opened this issue Dec 29, 2021 · 4 comments · Fixed by #15
Closed

example needs updating for CP 7.x #14

jepler opened this issue Dec 29, 2021 · 4 comments · Fixed by #15

Comments

@jepler
Copy link

jepler commented Dec 29, 2021

libraries/helpers/ble_adafruit/examples/ble_adafruit_feather_bluefruit_sense.py
90:mic_samples = ulab.zeros(MIC_NUM_SAMPLES, dtype=ulab.uint16)

libraries/helpers/ble_adafruit/examples/ble_adafruit_clue.py
64:mic_samples = ulab.zeros(MIC_NUM_SAMPLES, dtype=ulab.uint16)

these need to be updated to use ulab.numpy

@jmangum
Copy link

jmangum commented Dec 29, 2021

Regarding @jepler comment, I have tested this using:
import ulab .numpy as np
and
mic_samples = np.zeros(MIC_NUM_SAMPLES, dtype=np.uint16)

Also tested it using a perhaps cleaner:
import ulab
and
mic_samples = ulab.numpy.zeros(MIC_NUM_SAMPLES, dtype=ulab.numpy.uint16)
(which is, I believe, @jepler suggested change).

@rsbohn
Copy link

rsbohn commented Dec 30, 2021

Seems like we're only using ulab.numpy to get an array of 16 bit values. Could probably use array.array instead.

@dhalbert
Copy link
Contributor

Seems like we're only using ulab.numpy to get an array of 16 bit values. Could probably use array.array instead.

We do

            mic_svc.sound_samples = mic_samples - 32768

which relies on ulab.numpy operations.

@rsbohn
Copy link

rsbohn commented Dec 30, 2021

Ah, I see.

Looks like we're working on the same issue, you're just ahead of me.

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 a pull request may close this issue.

4 participants