Teaching my robot to hear, stuck again...
Promagic
Posts: 17
*Sigh*·I have been working and sleeping on this one for two weeks....with no avail...
···· I have been told before to make a filter, so·I have been attempting to make one..
First we have the raw 0-255 value from my adc connected to my sound sensor, my code attempts to make an average of about 100 added together adc values, then divides by 100.
I have been tinkering with everything. Any help would be awesome!
I have also attached some older versions of my code, 1.5 is the newest.
THANKS!!!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
···· -Devin
"I can only ask every question once."
···· I have been told before to make a filter, so·I have been attempting to make one..
First we have the raw 0-255 value from my adc connected to my sound sensor, my code attempts to make an average of about 100 added together adc values, then divides by 100.
I have been tinkering with everything. Any help would be awesome!
Sound: FOR a = 1 TO 5 b = b + adcBits 'make a total of 5 adc values IF a = 5 THEN mean1 = b / 5 'devide the total by 5 to get an Average sound lvl 'DEBUG DEC4 ? b, DEC4 ? adcBits, DEC4 ? mean1, DEC1 ? a, CR, CR 'mean1 = 0 'reset average b = 0 'reset total ENDIF DEBUG DEC5 ? mean1, DEC3 ? adcBits ,DEC5 ? b, HOME NEXT 'FOR a = 1 TO 100 'Dads attempt ' b = b + adcBits 'NEXT 'mean1 = b/100 'DEBUG DEC4 ? mean1, DEC5 ? b, DEC4 ? adcBits, CR 'RETURN
I have also attached some older versions of my code, 1.5 is the newest.
THANKS!!!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
···· -Devin
"I can only ask every question once."
Comments
John Abshier