Skip to content

Commit fdf9e3e

Browse files
committed
force sensor reading to be non-negative
very lazy fix
1 parent 1f0944e commit fdf9e3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

noisemeter-device/noisemeter-device.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ void setup() {
172172
*/
173173
void loop() {
174174
if (auto db = SPL.readMicrophoneData(); db) {
175-
packets.front().add(*db);
175+
packets.front().add(std::max(*db, 0.f));
176176
printReadingToConsole(*db);
177177
}
178178

0 commit comments

Comments
 (0)