Skip to content

Commit

Permalink
force sensor reading to be non-negative
Browse files Browse the repository at this point in the history
very lazy fix
  • Loading branch information
tcsullivan committed Jan 18, 2025
1 parent 1f0944e commit fdf9e3e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion noisemeter-device/noisemeter-device.ino
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ void setup() {
*/
void loop() {
if (auto db = SPL.readMicrophoneData(); db) {
packets.front().add(*db);
packets.front().add(std::max(*db, 0.f));
printReadingToConsole(*db);
}

Expand Down

0 comments on commit fdf9e3e

Please sign in to comment.