Skip to content

Commit

Permalink
Merge pull request #22 from tlyu/fix-clue-mic
Browse files Browse the repository at this point in the history
fix mic on Clue demo
  • Loading branch information
dhalbert authored Jun 22, 2022
2 parents 58c8cb6 + 493ee62 commit 0503f11
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/ble_adafruit_clue.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,12 @@
clue._mic.record( # pylint: disable=protected-access
mic_samples, len(mic_samples)
)
# Need to create an array of the correct type, because ulab
# seems to get broadcasting of builtin Python types wrong.
offset = np.array([32768], dtype=np.uint16)
# This subtraction yields unsigned values which are
# reinterpreted as signed after passing.
mic_svc.sound_samples = mic_samples - 32768
mic_svc.sound_samples = mic_samples - offset
mic_last_update = now_msecs

neopixel_values = neopixel_svc.values
Expand Down

0 comments on commit 0503f11

Please sign in to comment.