Skip to content

Commit 10999d8

Browse files
finneyjmicrobit-carlos
authored andcommitted
Reduce sensitivity of microphone to permit detection of 35db
1 parent 372d7ff commit 10999d8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

source/MicroBitAudio.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ MicroBitAudio::MicroBitAudio(NRF52Pin &pin, NRF52Pin &speaker, NRF52ADC &adc, NR
8484

8585
//Initilise level detector SPL and attach to splitter
8686
//levelSPL = new LevelDetectorSPL(*rawSplitter->createChannel(), 85.0, 65.0, 16.0, 0, DEVICE_ID_MICROPHONE, false);
87-
levelSPL = new LevelDetectorSPL(*rawSplitter->createChannel(), 85.0, 65.0, 16.0, 52.0, DEVICE_ID_SYSTEM_LEVEL_DETECTOR);
87+
levelSPL = new LevelDetectorSPL(*rawSplitter->createChannel(), 85.0, 65.0, 4.0, 35.0, DEVICE_ID_SYSTEM_LEVEL_DETECTOR);
8888

8989
//Initilise stream splitter
9090
splitter = new StreamSplitter(processor->output, DEVICE_ID_SPLITTER);
@@ -94,13 +94,13 @@ void MicroBitAudio::periodicCallback()
9494
{
9595
if (mic->isEnabled() && !micEnabled)
9696
{
97-
DMESG("MicroBitAudio::periodicCallback: activateMic()...");
97+
//DMESG("MicroBitAudio::periodicCallback: activateMic()...");
9898
activateMic();
9999
}
100100

101101
if (!mic->isEnabled() && micEnabled)
102102
{
103-
DMESG("MicroBitAudio::periodicCallback: deactivateMic()...");
103+
//DMESG("MicroBitAudio::periodicCallback: deactivateMic()...");
104104
deactivateMic();
105105
}
106106
}
@@ -109,7 +109,7 @@ void MicroBitAudio::activateMic(){
109109
runmic.setDigitalValue(1);
110110
runmic.setHighDrive(true);
111111
adc.activateChannel(mic);
112-
adc.getChannel(microphone, false)->setStartDelay(3);
112+
adc.getChannel(microphone, false)->setStartDelay(1);
113113
this->micEnabled = true;
114114
}
115115

0 commit comments

Comments
 (0)