Page 1 of 2
How to trigger sound from accelerometer output
Posted: 10 Mar 2011, 02:54
by mediciportfolio
Does anyone have a sample or example (or a pointer to instructions) on how to trigger a sound from accelerometer sensor output? Thanks
Re: How to trigger sound from accelerometer output
Posted: 10 Mar 2011, 04:22
by mattallen37
Can you be more specific? What language are you using? Do you know how to get the value to begin with? What circumstance(s) do you want to trigger the "sound"?
Re: How to trigger sound from accelerometer output
Posted: 10 Mar 2011, 07:24
by mightor
The only way to trigger a sound from the accelerometer is by throwing it on the floor or wall (make sure it's concrete or tiles, carpets or not great for making loud sounds). Your sensor may or may not work so well for actual acceleration measurements afterwards.
- Xander
Re: How to trigger sound from accelerometer output
Posted: 10 Mar 2011, 19:32
by loopymech
By applying a high voltage to the accelerometer inputs, you can trigger a brief "popping" sound (quite possibly accompanied by white smoke). However, this too is likely to degrade your accelerometer's performance.
-Loopy
Re: How to trigger sound from accelerometer output
Posted: 14 Mar 2011, 13:22
by hassenplug
Oh, my turn... build a device to fire the sensor faster than the speed of sound. It should (may?) create some sort of noise as it breaks the sound barrier.
Or, connect it to an NXT, and watch the value on the correct axis to see if it's larger than a give threshold. When it is, play a sound.
Re: How to trigger sound from accelerometer output
Posted: 14 Mar 2011, 16:56
by mightor
hassenplug wrote:Or, connect it to an NXT, and watch the value on the correct axis to see if it's larger than a give threshold. When it is, play a sound.
Too easy.
- Xander
Re: How to trigger sound from accelerometer output
Posted: 14 Mar 2011, 19:04
by HaWe
can the thread title be a Google translate artefact?
Re: How to trigger sound from accelerometer output
Posted: 14 Mar 2011, 19:18
by haydenstudios
I don't know what programming language you use. A majority of us here prefer NXC. But in case I'm lucky enough for this to be helpful and you do use NXT-G, I'll show you a little demo of how you would do it in NXT-G. So, now getting serious like Matt was TRYING to be,
I would first drag an infinite loop block onto the workspace, then Drag the acceleration sensor block inside of it, and plug the x axis into a multiplication block which will multiply the value by 10, then drag a sound block into the loop, and configure it to play a tone for 0.1 seconds. Now plug the result into the tone port on the sound block. And that should be it! Here is what it should look like:
Also, if you do not have the HiTechnic Acceleration sensor block, then you may download it here:
http://www.hitechnic.com/upload/744-Acc ... Sensor.zip
If you already have the aceleration sensor block, and you don't want to go through all of the hassle of doing this yourself, then just download my sample program at the bottom.
Re: How to trigger sound from accelerometer output
Posted: 14 Mar 2011, 20:39
by mattallen37
lol, I like the jokes.
@haydenstudios Unless he wants to trigger if greater than a certain level. Then he could use a comparator and a switch (maybe just a switch, I forget exactly how they work in NXT-G).
Re: How to trigger sound from accelerometer output
Posted: 14 Mar 2011, 21:17
by haydenstudios
Yes, you're right Matt. I do see that I slightly miss interpereted his words. But even then, we still do not know what language he uses. So my stuff might not be helpful at all. I usually try not to judge people based on such little information, but I commonly get the impression that people with one post this late on in the creation of this forum, and with the same join date as the creation date of the thread they started are relatively new to NXT, and use NXT-G.