Sound Impact Sensor, lost :(


i working in group on project using parallax sound impact sensor , aren't best programmers in world. on parallax website there "basic stamp(r)  2 program, not sure means exactly, anyways trying work arduino , don't know how can work.


here code parallax website. , appreciated.
 
code: [select]
' {$stamp bs2}
' {$pbasic 2.5}
do
if in0 = 1 ' when noise detected, display
debug home, "sound detected!", clreol ' message
pause 1000
else ' if no sound detected,
debug home,"all well", clreol ' display well.
endif
pause 10 ' short delay
loop ' repeat

a basic stamp different type of microcontroller, using different interfaces , totally different programming language. (a version of basic.)

it looks me "sound impact sensor" pulls digital input pin high when detects impact. that's vibration sensor i've created does. should able wire input digital input in on arduino  , use digitalread command check impacts.

wire +5v , ground pins of sensor power , ground on arduino. attach sensor output available digital input pin on arduino (say pin 2, example.) code might this:

code: [select]
#define soundpin 2 //this code uses digital input pin #2. change line pin number using.

void setup()
{
   pinmode(soundpin, input);
}

void loop()
{
  if (digitalread(soundpin) == true)
  {
    //sound detected, whatever need do.
  }
}
     



i working in group on project using parallax sound impact sensor , aren't best programmers in world. on parallax website there "basic stamp(r)  2 program, not sure means exactly, anyways trying work arduino , don't know how can work.


here code parallax website. , appreciated.
 
code: [select]
' {$stamp bs2}
' {$pbasic 2.5}
do
if in0 = 1 ' when noise detected, display
debug home, "sound detected!", clreol ' message
pause 1000
else ' if no sound detected,
debug home,"all well", clreol ' display well.
endif
pause 10 ' short delay
loop ' repeat



Arduino Forum > Using Arduino > Sensors > Sound Impact Sensor, lost :(


arduino

Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support