File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -165,6 +165,7 @@ int microbit_hal_compass_get_heading(void);
165
165
void microbit_hal_microphone_init (void );
166
166
void microbit_hal_microphone_set_threshold (int kind , int value );
167
167
int microbit_hal_microphone_get_level (void );
168
+ float microbit_hal_microphone_get_level_db (void );
168
169
169
170
const uint8_t * microbit_hal_get_font_data (char c );
170
171
Original file line number Diff line number Diff line change @@ -59,4 +59,11 @@ int microbit_hal_microphone_get_level(void) {
59
59
return value;
60
60
}
61
61
62
+ float microbit_hal_microphone_get_level_db (void ) {
63
+ uBit.audio .levelSPL ->setUnit (LEVEL_DETECTOR_SPL_DB);
64
+ float value = uBit.audio .levelSPL ->getValue ();
65
+ uBit.audio .levelSPL ->setUnit (LEVEL_DETECTOR_SPL_8BIT);
66
+ return value;
67
+ }
68
+
62
69
}
You can’t perform that action at this time.
0 commit comments