BG1, PRELOAD BG2, PRELOAD

Page 2 of 2 FirstFirst 1 2
Results 21 to 26 of 26
  1. #21

    Default

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

  2. #22

    Default

    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...)

  3. #23

    Default

    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.

  4. #24

    Default

    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

  5. #25

    Default

    Quote Originally Posted by tetsujin View Post
    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.
    This, IMHO, is absolutely brilliant. It doesn't even care if more than one toggle switch is modified during the same clock tick.

    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.

  6. #26
    Sackperson mutant_red_peas's Avatar
    Points: 8,765, Level: 28
    Level completed: 3%, Points required for next Level: 585
    Overall activity: 0%

    PSN
    Aquila_Shock-99
    Join Date
    Feb 2010
    Location
    Cheshire, England
    Posts
    524
    Blog Entries
    8

    Default

    Queued!

    I had another suggestion but I guess you don't need it now.....

    Sig by Pigg(abling)

    Mai LBP.me

    Aquila_Shock-99

    LBP2 Platinum! Yayz!

Page 2 of 2 FirstFirst 1 2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •