Ping output used as a piezoelectric speaker input?
I used the kickstart program (p77) for the PING))) ULTRASONIC DISTANCE SENSOR. In the Do Loop I entered Freqout mypin, time constant, x. where x = inDistance.
I was able to get the frequency coming out of the piezoelectric speaker to change as I moved my hand towards and away from the PING))) sensor. The only problem is I could not figure out how to get into the higher frequencies. Through trill and error I figured out that I was in the 200-20 Hz range. I tried to mess with x by adding 2000, but could not get into the higher frequencies. I also tried to mess with the InConstant to see if I could increase the input signal, to the speaker, before it got the inDistance variable. That didn't work either.
Does any one know how I could use the PULSIN as a feedback to an output to the Freqout command and be able to control what the output signal is?
ps I have been able to use an IF statement with an embeded freqout command (inside the Do Loop). where the Freqout command had a numeric value in the hz postition. I think of this like a discrete input I would like to develop something that is analog.
I was able to get the frequency coming out of the piezoelectric speaker to change as I moved my hand towards and away from the PING))) sensor. The only problem is I could not figure out how to get into the higher frequencies. Through trill and error I figured out that I was in the 200-20 Hz range. I tried to mess with x by adding 2000, but could not get into the higher frequencies. I also tried to mess with the InConstant to see if I could increase the input signal, to the speaker, before it got the inDistance variable. That didn't work either.
Does any one know how I could use the PULSIN as a feedback to an output to the Freqout command and be able to control what the output signal is?
ps I have been able to use an IF statement with an embeded freqout command (inside the Do Loop). where the Freqout command had a numeric value in the hz postition. I think of this like a discrete input I would like to develop something that is analog.
Comments