I think that will work tdarb, i'll go try it out. I'll make sure to credit your counter, it's very handy.

- Forum
- LittleBigPlanet 2 - 3 - Vita - Karting
- LittleBigPlanet 2
- [LBP2] Help!
- Addition using toggle logic switches
Results 21 to 26 of 26
-
02-09-2011 #21
-
02-09-2011 #22
OK, so your goal is just to have a display of the number of toggles activated, right? Not necessarily to have the total number of "on" switches be the value of one of LBP2's built-in "counter" objects?
Probably the easiest way to count the toggles is to combine them to create an analog signal. Set up a battery at 1%, and wire each input switch to an AND gate with that battery on the other terminal. Then get a battery at 100% and hook it to the positive side of a direction combiner, and hook the output of one of those AND gates to the negative side. The output of the direction combiner will be an analog signal that's either 100 or 99 depending on whether the switch was active. Keep doing this, chaining the output of a direction combiner to the positive input of another direction combiner, and the output of one of the AND gates to the negative side. Ultimately you'll get an analog signal that's (100% - (number of switches active)%) - pass that through a NOT gate and the analog signal will just be (number of switches active)%. Then feed that into a logic meter (build your own or find one online) and you'll have a display of the number of active switches.
Alternately you could build a big binary adder: take the switches in groups of two and turn the inputs into two-bit counts (A AND B -> value 2, A XOR B -> value 1, else value 0) - then take pairs of values, add them together with a binary adder until you've reduced the whole thing to a single binary sum. (Then you'll need to display the binary sum - you could do that by turning it into an analog value and displaying it with a logic probe, or you could create a binary-to-decimal decoder and do it that way...)
-
02-09-2011 #23
Wow, I can't say this is how I was expecting to play this game.
Works perfectly, thanks tdarb and everyone else.
Here is the final product for anyone following along: http://lbp.me/v/xmqpfj .Last edited by Aya042; 02-10-2011 at 10:08 AM.
-
02-10-2011 #24
I added it to my queue. I made a somewhat more primitive Lights Out game in LBP1, so i can't wait to see it!!
Mine is still uploaded too I think, if you would like to have a look
-
02-10-2011 #25Sack
- Join Date
- Oct 2008
- Posts
- 153
This, IMHO, is absolutely brilliant. It doesn't even care if more than one toggle switch is modified during the same clock tick.Probably the easiest way to count the toggles is to combine them to create an analog signal. Set up a battery at 1%, and wire each input switch to an AND gate with that battery on the other terminal. Then get a battery at 100% and hook it to the positive side of a direction combiner, and hook the output of one of those AND gates to the negative side. The output of the direction combiner will be an analog signal that's either 100 or 99 depending on whether the switch was active. Keep doing this, chaining the output of a direction combiner to the positive input of another direction combiner, and the output of one of the AND gates to the negative side. Ultimately you'll get an analog signal that's (100% - (number of switches active)%) - pass that through a NOT gate and the analog signal will just be (number of switches active)%. Then feed that into a logic meter (build your own or find one online) and you'll have a display of the number of active switches.
BTW, it's not too tough to put this analog signal through an ADC microchip to convert it to a pulse stream. This could feed the counter he is already using.Last edited by Shanghaidilly; 02-10-2011 at 03:09 PM.
-
02-10-2011 #26Sackperson
- PSN
- Aquila_Shock-99
- Join Date
- Feb 2010
- Location
- Cheshire, England
- Posts
- 524
- Blog Entries
- 8
Queued!
I had another suggestion but I guess you don't need it now.....
«
Previous Thread
|
Next Thread
»
All times are GMT. The time now is 01:07 AM.
Powered by vBulletin® Version 4.2.2
Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.
Extra Tabs by vBulletin Hispano
Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.
Image resizer by SevenSkins
Extra Tabs by vBulletin Hispano
Reply With Quote


