+ Reply to Thread
Results 1 to 6 of 6

Thread: What's wrong with this circuit?

  1. #1
    Wire Noob Aero's Avatar
    Join Date
    Aug 2007
    Posts
    6

    Default

    I'm making the controller for letting people choose what floor they want from inside the car, but I can't seem to get it to work right. This is how it looks:



    For some reason, it only goes up and down in increments of 4, letting me only chose floors 1, 5, 9, 13 and 15. Does anyone know what I did wrong? I just started with wire a few days ago

  2. #2
    Wire Amateur Razoul's Avatar
    Join Date
    Jun 2007
    Location
    New Jersey
    Posts
    83

    Default

    What happens if you hold the + or - button, does it keep going up, or change only once?

    My only thought would be the legnth of time your holding the butting is allowing the add to run through more than once, it would pass 4 (in this case) differant values, setting those to the memory just to be added again.

    Run my test, if it continues to change while holding a button then the problem is what I stated above, if it changes only once while holding the button then I am at a loss for what is going on.

    You might also try using the Debugger tool on your chips to see where the problem is occuring.
    -Indecision may or may not be a problem...

  3. #3
    Aut
    Aut is offline
    Wire Amateur Aut's Avatar
    Join Date
    Jun 2007
    Posts
    66

    Default

    Don't use D-latch memory. Use Latch(edgetriggered) and see, D-latch will change the value while the button is pressed, Latch(edge) will only change the value when the clock first flips from 0 to 1.

  4. #4
    Wire Noob Aero's Avatar
    Join Date
    Aug 2007
    Posts
    6

    Default

    When I hold it, it doesn't keep going up, it only goes up by 4 once, until I press it again.

    I switched to Latch (edge triggered) but with this, the value doesn't change at all, it stays at 1 when I press the button

    Edit: I think this is because the clock get switched on before the value is updated, so it always stays at what it is. I changed it so that the clock was based on a delta, and this allowed me to go upwards properly, but not down. It half works...

  5. #5
    Wire Amateur Razoul's Avatar
    Join Date
    Jun 2007
    Location
    New Jersey
    Posts
    83

    Default

    Might be a bit overkill, but I would suggest using an expression for this (fewer chips, easier to change/add later)

    Code:
    N@Elevator
    I@Up Down
    O@Floor
    ~Up & Up -> Floor = clamp(Floor + 1, 1, 15);
    ~Down & Down -> Floor = clamp(Floor - 1, 1, 15);
    Edit: Made it so Floor will never be greater than 15, or less than 1.
    -Indecision may or may not be a problem...

  6. #6
    Wire Noob Aero's Avatar
    Join Date
    Aug 2007
    Posts
    6

    Default

    Thanks, it works now with the expression gate.

+ Reply to Thread

Similar Threads

  1. Save is apparently breaking my circuit
    By Belarr in forum Installation and Malfunctions Support
    Replies: 4
    Last Post: 02-22-2009, 01:25 AM
  2. What am I doing wrong? :(
    By McLovin in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 7
    Last Post: 10-07-2008, 02:59 PM
  3. Is something wrong?
    By JimGR in forum Installation and Malfunctions Support
    Replies: 19
    Last Post: 01-01-2008, 10:36 PM
  4. Timed Countdown Detonator (Circuit Diagram)
    By evileliminator in forum Gate Nostalgia (Old School Wiring) Discussion & Help
    Replies: 9
    Last Post: 07-12-2007, 03:27 AM
  5. Circuit Board Macro
    By Qjet in forum Ideas & Suggestions
    Replies: 3
    Last Post: 03-27-2007, 09:09 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots