Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Help!
#1

Button and 3 values

Archive: 7 posts


I have 3 wheels, with a key switch on each. And , when I press a red button, depending if all keys are activated, I get an award, or just get a buzzer. How do I connect the button? I do have the key switches connected to an AND switch.2011-07-28 20:40:00

Author:
DragonSackBoy
Posts: 17


Yes use an AND gate 2011-07-28 22:00:00

Author:
Zero10100
Posts: 385


The problem is that when some of the switches are not on and one or two is on, nothing will happen. I want it so that if none, one or two key switches are activated,when the button is pressed, a buzzer sounds, and if all 3 are activated, you hear a fanfare and are awarded a prize.

here's how the whole thing looks:

http://imageshack.us/photo/my-images/97/lbp2safecracker.jpg/
2011-07-28 23:23:00

Author:
DragonSackBoy
Posts: 17


Use an AND gate for 1+2, 1+3, 2+3 and wire them into an OR gate with 02011-07-28 23:57:00

Author:
Zero10100
Posts: 385


Okay! thank you. I'l try that.2011-07-29 02:31:00

Author:
DragonSackBoy
Posts: 17


Looks like I'm late to the party... glad you got help!
Here's what I would do... (explanation is long, but solution is pretty simple)

http://i.imgur.com/igV3c.gif

STEPS
1) Add another input to the first AND gate (4 inputs).
2) Wire your button to the first AND gate.
3) Add a second AND gate (2 inputs) and a NOT gate.
4) Wire the first AND gate to the NOT gate.
5) Wire the NOT gate to the second AND gate.
6) Wire your button to the second AND gate.

Output from the first AND gate for your "yes" stuff (fanfare, prize, etc.).
Output from the second AND gate for your "no" stuff (error sound).

WHAT IT DOES
Basically, when all 3 keys are ready and you press the button,
all 4 inputs for the AND gate become active, and play the fanfare.
But at any given time, if 1 of those 4 inputs is not active, it feeds
a signal to the NOT gate. So whenever you jump on the button without
the 3 keys activated, it stops dead at the first AND gate, but meets
requirements for the second AND gate, which plays the error sound.
Even though the button is wired to two different AND
gates, the signals are set up in a way that only one AND gate
will ever be fully active, so only one sound will play.

I love this stuff. Wish I had studied circuits at school now!

EDIT (updated)
You should also add a counter (count: 1) or short timer (count up to 0.1)
after the first AND gate but before the "yes" stuff (i.e. on the green wires in image).
This will stop the player from playing the fanfare or getting the prize more than once.

2011-07-29 02:50:00

Author:
Unknown User


Awesome. Thanks so much!2011-07-29 15:32:00

Author:
DragonSackBoy
Posts: 17


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.