niteshmourya / app-inventor-for-android

Automatically exported from code.google.com/p/app-inventor-for-android
Apache License 2.0
2 stars 0 forks source link

Wrong values from NXT SoundSen sor #2216

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This problem has to do with the reading from the NXTSoundSensor block.  I have 
talked to Liz Looney. She says this sensor has Sensormode RAW.  this gives a 
value from 0-1023 (it is a 10 bit voltage signal) and it does NOT have anything 
to do with soundlevel.    

Solution: Change the Sensormode tot PCTFullsvcale.  You will then get a value 
from 0-100% (let us call it dB%).  This value can so be changed to dB/dBA by 
using this equation:

                dB=8,35*ln(422*dB%)  (ln=Natural logarithm, e-based)

Also it is a good idea to a property, where one could select either dB or dBA. 
To switch between these two, only chagner the sensortype (DB or dBA)

Then this sensorblock will make sense, and I think it is an easy fix!

Original issue reported on code.google.com by svena...@gmail.com on 9 Aug 2012 at 7:35