This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-02-19 19:46:01

Magi-tak
Scratcher
Registered: 2009-12-31
Posts: 7

Please help

i just got a challenge on how to make the sprite know the difference between 1 clap and 2 claps, i would be psyched if any1 helped!

Offline

 

#2 2010-02-19 19:55:41

Greenboi
Scratcher
Registered: 2010-01-30
Posts: 1000+

Re: Please help

Huh?

Offline

 

#3 2010-02-19 20:12:00

Ace-of-Spades
Scratcher
Registered: 2010-01-08
Posts: 1000+

Re: Please help

Someone challenged Magi to a contest. He/she needs to make a sprite know the difference between 1 clap and 2 claps. If you mean claps in real life, I'm not your man. The Pico/Arduino Board or whatever it is your using makes no sense to me whatsoever.

If you mean claps in project, then you could use a variable and 'If' commands. Clap # is equal to the variable, and Forever if: Claps = 1, the sprite knows it equals 1 and does whatever it's supposed to do for one clap. The same thing for 2 claps. You could also use broadcasts, but I don't suggest it. You can add an infinite amount on different things the sprite can do, because you can have an infinite amount of claps play (though I don't recommend it. Infinity is such an unending number, and there would be endless lag if you did it).


11110010100011010100011010101000100011011011001010111100101000110101000110101010001000110110110010101111001010001101010001101010100010001101101100101011110010100011010100011010101000100011011011001010
110101010010001010101010101010101010101010100110101010010101010010101001101011010101010010101010101

Offline

 

#4 2010-02-19 20:15:01

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: Please help

If you mean like differentiating between 1 or 2 claps from the mic it should be something like this: http://scratch.mit.edu/projects/technoguyx/895703 This detects two claps if both are done in less than 0.5 seconds. There's a little glitch though, if you clap twice it says "2 claps!" then "1 clap!" (both broadcasts are broadcasted for some reason, don't use it in your project yet unless you can fix it or make it so the 2-clap broadcast can stop the 1-clap one).


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#5 2010-02-19 20:28:07

Ace-of-Spades
Scratcher
Registered: 2010-01-08
Posts: 1000+

Re: Please help

Instead of broadcasts, you can use variables. The signals won't cross each other then.


11110010100011010100011010101000100011011011001010111100101000110101000110101010001000110110110010101111001010001101010001101010100010001101101100101011110010100011010100011010101000100011011011001010
110101010010001010101010101010101010101010100110101010010101010010101001101011010101010010101010101

Offline

 

#6 2010-03-18 22:18:18

Magi-tak
Scratcher
Registered: 2009-12-31
Posts: 7

Re: Please help

I finally finished this challenge and succesfully completed it and I owe it all to u! smile  thanx again!

Offline

 

Board footer