1. If you're looking for help-related things (for example, the key rebinding tutorial), please check the FAQ and Q&A forum! A lot of the stickies from this forum have been moved there to clean up space.
    Dismiss Notice

If and only if? Wiring

Discussion in 'Starbound Discussion' started by sagenth, Feb 22, 2015.

  1. sagenth

    sagenth Pangalactic Porcupine

    I have been creating a wiring system for my ship's flight cabin. I use a proximity sensor on one side in conjunction with a hand print scanner. On the other side I use a simple pressure plate.

    I have it set up to open the door and turn on the lights if you are outside. The pressure plate on the other side opens the door and turns the lights on permanently. Unfortunately however, the proximity sensor and pressure plate are too close together.

    When I am outside and open the door I have no problems, but then when I proceed by running inside and past the pressure plate the proximity is still on, so it is still sending a signal to the pressure plate's latch which keeps the lights from STAYING on. I would like to append another "statement" to that latch's toggle signal from the proximity. I'd like it to go like this:

    If and only if the plate sensor has not just been stepped on turn the latch off. If possible, I would keep the plate pressure the same.. If the plate is being stepped on turn the latch on, and thus keep the lights on.

    Is what I am trying to do possible? Should I do this all a different way? I am merely trying to keep the lights on (IF the door is open OR IF the pressure plate has been triggered). I have limited space I can only add perhaps 3 more wiring statements to my circuit.

    edit: I didn't explicitly state this, but the door stays closed unless you are actually on the pressure plate. So I can't just use the door for the lights all the time. If I did I would still have the same problem I have now, but for a different action.
     
  2. SeaJay

    SeaJay Space Kumquat

    My head is in such a scramble right now. I'd be happy to help, but a screenshot would make it much easier for me to visualise your situation.

    Also, what turns the lights off?
     
    Last edited: Feb 22, 2015
    Snowpup likes this.
  3. lusername

    lusername Scruffy Nerf-Herder

    Okay, let me see if I understand what you're trying to construct here: You want an automatically opening door that also happens to turn the cockpit lights on while you're inside, and off when you leave, is that it?

    I would recommend you disconnect the internal cockpit sensor from controlling the lights at all, since it will trigger a false positive as you described, and wire your light toggle circuitry exclusively to the door, such that the door opening toggles the light. Of course, more complex would be one that actually determines if you are actually INSIDE the cockpit, as opposed to the door merely being opened an odd number of times, in case you open the door, but do not leave. This would, however, require more sensors installed in the cockpit to determine whether you are actually present, as opposed to whether or not the door has been opened an even or odd number of times...but at least it wouldn't get confused if there are other things moving around in your ship that could trigger the doors without you leaving. That way pets and guests would not disrupt your counter when they enter or exit.
     
    Last edited: Feb 22, 2015
  4. Sirrobert

    Sirrobert Big Damn Hero

    Proximity plate on each side, to the door, and to a persistent switch. Outside plate to buttom of the switch, Inside to top of the switch. Output of the switch to the lights.

    Asuming that is what you want.
    What this does is, if you step on the inside plate it turns the lights on, and if you step on the inside plate it turs the lights off. Both plates directly open the door, which closes again if you step off the plate
     
  5. sagenth

    sagenth Pangalactic Porcupine

    As a programmer I tend to not like work-arounds and I feel the same towards this. If it is possible, I'd like to work through the issue rather than around it.

    This is the logic setup I have:
    Logic.PNG

    This is the wiring I have:
    Wiring.PNG

    I made this on the surface of a planet as a prototype because the version on my ship is a whole hell-of-a-lot harder to read. It takes up probably 7 times less space.

    The only idea I have come up with to solve this problem is to use a timer for the proximity sensor but I do not fully understand how the timers work. (The built in timers that is)
    What turns the lights off is the door closing with the pressure plate latch not giving any input.
     
    Last edited: Feb 22, 2015
  6. SeaJay

    SeaJay Space Kumquat

    I'm super tired today, but this might serve your needs (or at least close enough to modify it to your liking). It uses a Persistent Switch (a SR latch). The outside stuff turns on the bulb and door, but removes any latching on the bulb. The pressure plate opens the door and latches on the bulb. I'm not totally sure why there's both a hand scanner and a proximity scanner outside. I put my proximity scanner a little too far from the door in this one.

     
    Xuxilbara likes this.
  7. sagenth

    sagenth Pangalactic Porcupine

    Oh wow, thanks so much! This has simplified the logic so much.. I had like 5 unnecessary logic gates!
     
  8. SeaJay

    SeaJay Space Kumquat

    You're welcome. I'm glad to hear that it helped, I was worried that I had missed the point entirely. :)
     
  9. Engezerstorung

    Engezerstorung Aquatic Astronaut

    ive done pretty much the same things but with 2 detector directly on each side
    work pretty well
    except when the cat come in the room and go out, and leave me in the dark...
    so the addition of an outside button is a good idea, but at first i wanted to have fully automated door
     

Share This Page