I have a bunch of toggle switches that I want to connect to a counter, but I want the counter to only display how many are active as apposed to how many times they've been toggled. Any advice would be much appreciated. Let me know if my question isn't clear.

- Forum
- LittleBigPlanet 2 - 3 - Vita - Karting
- LittleBigPlanet 2
- [LBP2] Help!
- Addition using toggle logic switches
Results 1 to 20 of 26
-
02-09-2011 #1
Addition using toggle logic switches
-
02-09-2011 #2Sack
- Join Date
- Oct 2008
- Posts
- 153
Question: is something "triggering" the count of the enabled toggle switches? Or do you want the counter to keep up with them in real time?
-
02-09-2011 #3Sackperson
- PSN
- Aquila_Shock-99
- Join Date
- Feb 2010
- Location
- Cheshire, England
- Posts
- 524
- Blog Entries
- 8
Does it have to still be 'displayed'?
Try having it so the counter activates 2 NOT switches, one the opposite to the other. One resets the counter. The other one makes it go up. This one has to be the one that is off when it's actually OFF. So when the toggle witch is on, the counter is up. When not, it is reset. Each counter must have to have a target of 1.
Hope that helps.
-
02-09-2011 #4Sack
- Join Date
- Oct 2008
- Posts
- 153
When you say counter, do you mean like the counter that is in the LBP2 tools? Or do you mean a counter like on a calculator that displays the number?
Last edited by Shanghaidilly; 02-09-2011 at 07:17 PM.
-
02-09-2011 #5Sackperson
- PSN
- Aquila_Shock-99
- Join Date
- Feb 2010
- Location
- Cheshire, England
- Posts
- 524
- Blog Entries
- 8
I mean counter as in the one in the Tools Bag.
-
02-09-2011 #6
Sorry for the confusion, I'm using a calculator display type counter, not the one in tools. I tried spreading out the toggle logic switches on a sequencer and activating the sequencer at the end to count "active" signals, but when you put the toggle into a sequencer it removes the input. So in the end I want the display to show how many times toggles have been flipped minus redundant moves.
-
02-09-2011 #7Sackperson
- PSN
- Aquila_Shock-99
- Join Date
- Feb 2010
- Location
- Cheshire, England
- Posts
- 524
- Blog Entries
- 8
Why don't you have it so 2 numbers together in an AND switch make the answer (when they're added together) light up on the calculator display.
Example using tag sensors:
Light Green = 1
Green = 2
Yellow = 3
Light Blue = 4
Blue = 5
Pink = 6
Purple = 7
Red = 8
When the light green and blue tag sensors are activated they go into their AND switch and make the number when they're added together (6 in this case) appear on the display.
Then make something else logicy for a different operation. There's only 4 operations
Then you can use a selector and each AND switch with an extra port (for the selector output, which feeds into it when the operation is selected) so the selector chooses the operation.
Sorry if that's too much...
-
Thanks!
-
02-09-2011 #8Sack
- Join Date
- Oct 2008
- Posts
- 153
Whoa, now I'm really confused. In your original post, you said you wanted to just count the enabled toggles. Now you want to know how many times each of them were toggled on and off? Aren't those two different things? Also, what does your counter work off of? I mean, what type of input does it expect let's say if 5 toggles are on.
-
Thanks!
-
02-09-2011 #9Sackperson
- PSN
- Aquila_Shock-99
- Join Date
- Feb 2010
- Location
- Cheshire, England
- Posts
- 524
- Blog Entries
- 8
The original one worked off counters from tools bag. But then you said it's counters off the calculator.
The second thing is powered by the numbers selected on either side of the operation sign. If the player selects 4 and 6, the 2 numbers power an AND switch which lights up the number 10.
Every number should be in invisible holo on the display, I think.
-
Thanks!
-
02-09-2011 #10
I thought it meant the same thing, counting enabled toggles is the goal. I'm using this counter if that helps http://lbp.me/v/x94vgt . I'm gonna see what i can make of mutant's suggestion.
-
02-09-2011 #11Sackperson
- PSN
- Aquila_Shock-99
- Join Date
- Feb 2010
- Location
- Cheshire, England
- Posts
- 524
- Blog Entries
- 8
Thanks, I like seeing if what I say works. Post what happens on my Visitor Messages page.
Also I don't like people calling me 'mutant'. FourteenInchGaz calls me Mr. Peas, I like that name
-
02-09-2011 #12
I think i understand what your saying but i think i have a slightly different situation, let me clarify a bit further. I have 25 toggles in a grid and you can switch them on and off. I want the counter to display how many of those toggles are on, either in real time or at the end, doesn't matter which. I think your way might work but with a ton of wiring, i feel like there may be an easier way.
-
02-09-2011 #13Sack
- Join Date
- Oct 2008
- Posts
- 153
Kraznoff - can more than one toggle switch be enabled or disabled at a time? What I mean is that whatever is turning them on or off, does it occur one toggle switch at a time, or can two toggle switches be turned on simultaneously? If not, then it's actually quite simple. Otherwise, I have a solution but will need to test it before trying to explain it off the top of my head (you'll still have to do a bit of wiring since you have 25 toggle switches to deal with).
Last edited by Shanghaidilly; 02-09-2011 at 08:44 PM.
-
02-09-2011 #14
Unfortunately from 3 to 5 can be toggled at a time.
-
02-09-2011 #15Sack
- Join Date
- Oct 2008
- Posts
- 153
That means that you're going to have to "work through" all the toggles switches and count them as you go. It should take approx. 1.5 seconds to "count" the switches. Is this acceptable?
-
02-09-2011 #16
What do you mean? And yes, 1.5 seconds is fine.
-
02-09-2011 #17
It's probably not the optimum solution here, but one way to do it would be to make a MC like the following.
Place a NOT gate on there. Have that run into a pulser (counter set to one and set to reset itself). Then run that out to the minus pole of a direction combiner.
Above that place a pulser, that runs into the positive pole of the direction combiner.
Run your toggle output to the NOT gate, and the pulser connected to the positive pole of the combiner.
Now every time your toggle flips, you should get a positive or negative signal you can send to the counter.
-
02-09-2011 #18Sack
- Join Date
- Oct 2008
- Posts
- 153
If two or more toggle switches are turned on at exactly the same time, then you'll only see one of them since you'll probably be ORing the outputs from all this together to go into the counter. So the counter would only go up by 1 instead of 2 (or 3 or more).It's probably not the optimum solution here, but one way to do it would be to make a MC like the following.
Place a NOT gate on there. Have that run into a pulser (counter set to one and set to reset itself). Then run that out to the minus pole of a direction combiner.
Above that place a pulser, that runs into the positive pole of the direction combiner.
Run your toggle output to the NOT gate, and the pulser connected to the positive pole of the combiner.
Now every time your toggle flips, you should get a positive or negative signal you can send to the counter.
-
02-09-2011 #19
Ok, so i have it set up now so only one toggle is toggled at a time, any ideas from here?
-
02-09-2011 #20
yes, but you are talking about .03 seconds per pulse to update the counter.
Aside from that, the only real downside is that it outputs to the counter directly. You would need a buffer object of some sort to hold the "sum" in, in order to output it to the display when the add condition is met.
«
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

