How to trigger sound from accelerometer output
-
- Posts: 1
- Joined: 10 Mar 2011, 02:53
How to trigger sound from accelerometer output
Does anyone have a sample or example (or a pointer to instructions) on how to trigger a sound from accelerometer sensor output? Thanks
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: How to trigger sound from accelerometer output
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"?
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
Re: How to trigger sound from accelerometer output
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
- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
Re: How to trigger sound from accelerometer output
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
-Loopy
-
- Posts: 346
- Joined: 27 Sep 2010, 03:05
- Contact:
Re: How to trigger sound from accelerometer output
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.
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.
---> Link to lots of MINDSTORMS stuff under my picture --->
Re: How to trigger sound from accelerometer output
Too easy.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.
- Xander
| My Blog: I'd Rather Be Building Robots (http://botbench.com)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
| RobotC 3rd Party Driver Suite: (http://rdpartyrobotcdr.sourceforge.net)
| Some people, when confronted with a problem, think, "I know, I'll use threads,"
| and then two they hav erpoblesms. (@nedbat)
Re: How to trigger sound from accelerometer output
can the thread title be a Google translate artefact?
-
- Posts: 252
- Joined: 22 Oct 2010, 20:05
- Location: The United States of America
- Contact:
Re: How to trigger sound from accelerometer output
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.
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.
- Attachments
-
- Acceleration sound.zip
- Please note that this program isn't perfect since I threw it together in a few minutes. For example you could change the multiplication from 10 to 100, or just not have it at all. Or you could change the duration of each tone from 0.1 seconds to 0.01 seconds, or to 1 second. This is really just a demo.
- (82.3 KiB) Downloaded 250 times
Last edited by haydenstudios on 15 Mar 2011, 02:40, edited 2 times in total.
-Hayden
-
- Posts: 1818
- Joined: 02 Oct 2010, 02:19
- Location: Michigan USA
- Contact:
Re: How to trigger sound from accelerometer output
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).
@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).
Matt
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
http://mattallen37.wordpress.com/
I'm all for gun control... that's why I use both hands when shooting
-
- Posts: 252
- Joined: 22 Oct 2010, 20:05
- Location: The United States of America
- Contact:
Re: How to trigger sound from accelerometer output
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.
-Hayden
Who is online
Users browsing this forum: No registered users and 1 guest