Programming with Sound Sensor


#1

Hello,
I got some sensors today and I got a sound sensor. I want to make a program that makes the robot move back when the sound sensor detects a sound. I tired many ideas but none of them seem to work. Can someone help direct me to a website or link that can help me?
Thank you!!!


#2

Hi adriana,

Which robot you have?
Bellow is an example program for reference:


#3

I tried this and nothing happened. I have a mbot. Further Explanation? :confused:


#4

The mBot does not have a sound sensor. Did you buy a sound sensor?


#5

Yes. I have one hooked up.


#6

Just trying to sort out the easy stuff first … did you change the program so it uses the port which you connected the sound sensor?

What happens if you just use the Say block to display the sound sensor reading instead of setting the motor speed?


#7

No. I’m just so confused. I’m new to all of this. I’ll try though.


#8

I did this and the panda said “Bye!” Am I doing it right?


#9

I dont have mBlock with me, so no screenshot, only text.

Try this small program.

when green flag
forever
say sound sensor port 4

You will need to replace port 4 by whatever port you connected the sound sensor.


#10

Mkay Thx


#11

Ohhhh I cant do that. The sound sensor port 4 block is circular so It does not work. :frowning:


#12

Should work anyway


#13

Hi,

What do you mean about “The sound sensor port 4 block is circular so It does not work”.
Anyway, please upgrade firmware for mBot refer to this instruction.
Then please test the following program:1. How to Upgrade Firmware for mBot.docx.zip (690.6 KB)


#14

Okay. Thanks. I will try this.


#15

Okay this worked, but how do I get it to move forward when enough sound is presented? :confused:


#16

Ok, please remember which value the panda says then you have “enough noise”. Lets assume this is 100. Then please expand the program:


#17

Yes! Finally! This works! Now my robot, Marcus can dance with my water speakers to Spooktune!! :grinning:
~(O.O)~


#18