Skip to content

Commit

Permalink
Use ulab to output signed sound samples for CLUE
Browse files Browse the repository at this point in the history
  • Loading branch information
dhalbert committed May 7, 2020
1 parent 869e963 commit c63619e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/ble_adafruit_clue_bluefruit.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import board
from digitalio import DigitalInOut
import neopixel_write
import ulab

from micropython import const

Expand Down Expand Up @@ -61,7 +62,7 @@
mic_svc.number_of_channels = 1
mic_svc.measurement_period = 100
mic_last_update = 0
mic_samples = array.array("H", [0] * MIC_NUM_SAMPLES)
mic_samples = ulab.zeros(MIC_NUM_SAMPLES, dtype=ulab.uint16)

temp_svc = TemperatureService()
temp_svc.measurement_period = 100
Expand Down Expand Up @@ -108,7 +109,7 @@
clue._mic.record(
mic_samples, len(mic_samples)
) # pylint: disable=protected-access
mic_svc.sound_samples = mic_samples
mic_svc.sound_samples = mic_samples - 32768
mic_last_update = now_msecs

neopixel_values = neopixel_svc.values
Expand Down

0 comments on commit c63619e

Please sign in to comment.