楼主: Forgotten
|
[教程] 【Mind+】如何解锁Mind+里面几十种传感器 |
狂风飙升 发表于 2020-1-20 00:02 需要公式转换的吧。 https://wiki.dfrobot.com.cn/_SKU_SEN0232_%E6%A8%A1%E6%8B%9F%E5%88%86%E8%B4%9D%E8%AE%A1#.E5.88.86.E8.B4.9D.E5.80.BC.E4.B8.8E.E7.94.B5.E5.8E.8B.E7.9A.84.E5.85.B3.E7.B3.BB [mw_shl_code=cpp,false]loat voltageValue,dbValue; voltageValue = analogRead(SoundSensorPin) / 1024.0 * VREF; dbValue = voltageValue * 50.0; //convert voltage to decibel value Serial.print(dbValue,1); Serial.println(" dBA");[/mw_shl_code] 读取的模拟值除以1024.0然后再乘以5.0,再乘以50.0就是分贝值了 |
smart6623 发表于 2020-2-20 03:10 可以尝试添加用户库哦 https://mindplus.dfrobot.com.cn/extensions-user |
© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed