Closed Thread
Page 350 of 353 FirstFirst ... 250300340348349350351352 ... LastLast
Results 3,491 to 3,500 of 3521
Like Tree5Likes

Thread: Expression Gate 2

  1. #3491
    Wire Tutor chinoto's Avatar
    Join Date
    Apr 2008
    Location
    Brooklyn Park, MN. Lost my thumbdrive yet again...
    Posts
    1,983

    Default Re: Expression Gate 2

    Quick! Flamewar about implementing functions to prevent that thread from being longer than this one. (I don't really care about the functions, its just a neat idea to me)
    (\__/) Expression 2 Resources: E2 Beginner's Guide | E2 Formatting Guide | E2 Function Reference | E2 Examples | Me
    (='.'=) PM me code and I'll send it back optimized if possible. (I find it fun dammit!)
    (")_(") Drunkie referring to an E2: "It's obvious that Chinoto made this, his coding style is all over it."

  2. #3492
    Wirererer Lancelot's Avatar
    Join Date
    Feb 2009
    Posts
    292

    Default Re: Expression Gate 2

    It's a useful one. The things it would allow people to do would be incredible, and leave the code much cleaner. I'm working on a fin aircraft right now and trying to work out the autopilot. I could say, have a function that makes the plane go somewhere, another that makes it circle that location, take off, land, allow manual control etc. Then you also need a function to get and display telemetry. Instead right now functions need to be cheaply mimicked.
    You know what I hate? Sentences with ridiculous and very purposefully implanted subliminal messages.

    Chinoto: I just explained an idea that requires no parenting or bacon sensor.

    MOOCOW Admin Mod Beta Tester

  3. #3493
    Ursus maritimus Drunkie's Avatar
    Join Date
    Feb 2009
    Location
    Canada
    Posts
    5,662
    Blog Entries
    1

    Default Re: Expression Gate 2

    Quote Originally Posted by Lancelot View Post
    Instead right now functions need to be cheaply mimicked.
    The dev's are aware about that. Functions have been suggested like thousands of times.

  4. #3494
    Wire Noob nachosdan's Avatar
    Join Date
    Mar 2010
    Posts
    2

    Default Re: Expression Gate 2

    I was wondering, how the code for an edge-triggered gate would look. I have been working with expression gates for about 10 minutes, but I've worked with HTML, PHP and javascript before.
    Could it look something like this?

    if ((A==1 | B==1) & C!=1) {C=1}
    else {C=0}

    if (C==1) {X=1}

  5. #3495
    No u Divran's Avatar
    Join Date
    Jul 2008
    Location
    Sweden
    Posts
    4,582

    Default Re: Expression Gate 2

    Not 100% sure what "edge" triggered actually does, but if I'm right, it's:
    Code:
    @inputs Toggle OnValue OffValue
    @outputs Out
    if (~Toggle & !Toggle) {
        Out = (Out == OnValue ? OffValue : OnValue)
    }
    SVN Tutorial
    My SVN:
    Code:
    http://divranspack.googlecode.com/svn/trunk/%20divranspack/
    Get dropbox and get 250 MB extra space: Dropbox

  6. #3496
    aka Colonel Never Online Colonel Thirty Two's Avatar
    Join Date
    Oct 2009
    Posts
    2,683
    Blog Entries
    5

    Default Re: Expression Gate 2

    It means it triggers when an input is changed. In digital electronics the waveform goes from 0 instantly to 1, hence creating an "edge."

  7. #3497
    No u Divran's Avatar
    Join Date
    Jul 2008
    Location
    Sweden
    Posts
    4,582

    Default Re: Expression Gate 2

    Quote Originally Posted by initrd.gz View Post
    It means it triggers when an input is changed. In digital electronics the waveform goes from 0 instantly to 1, hence creating an "edge."
    So say you have a button. Should it toggle when you first touch the button, or should it do nothing while you hold your finger down on it, and only react when you let go of the button? I have the second of the two in the above code. To change it into the first, simply remove the "!" from in front of the second "Toggle".
    SVN Tutorial
    My SVN:
    Code:
    http://divranspack.googlecode.com/svn/trunk/%20divranspack/
    Get dropbox and get 250 MB extra space: Dropbox

  8. #3498
    Wire Noob nachosdan's Avatar
    Join Date
    Mar 2010
    Posts
    2

    Default Re: Expression Gate 2

    Thank you. I messed my question a bit up, I think. I'm looking for a code, so I can have 2 buttons on each side of a door and then another button inside to lock the door.

  9. #3499
    Wire Noob ufoslava's Avatar
    Join Date
    Nov 2007
    Location
    Israel
    Posts
    16

    Default Re: Expression Gate 2

    Quote Originally Posted by Divran View Post
    So say you have a button. Should it toggle when you first touch the button, or should it do nothing while you hold your finger down on it, and only react when you let go of the button? I have the second of the two in the above code. To change it into the first, simply remove the "!" from in front of the second "Toggle".
    Quote Originally Posted by Wire Wiki
    @trigger-directive The trigger directive can selectively enable or disable inputs from triggering executions. Possible values are all/none, but also a list of inputs.
    @trigger all # old behaviour, inputs always trigger executions
    @trigger none # will never trigger from inputs, only timers, etc
    @trigger Time Button # will only trigger if Time or Button has changed


    So there you have it... make your expression run every time value is changed.

    Also, toggle button changes the value the moment you press it, no matter if you hold it or not.
    Non-toggle button changes the value back the moment you release it.
    Unlike humans, machines are really loyal, and always by your side...
    They wont care if you using other machine, moreover machines wont prefer anybody else to work on them...
    If you take a good care of it, it will return the favour, and operate well...

    Not like humans, who are cheating, killing with no reason, buying the law, getting drunk and betraying the closest...

    That's how the geeks were born...

  10. #3500
    aka Colonel Never Online Colonel Thirty Two's Avatar
    Join Date
    Oct 2009
    Posts
    2,683
    Blog Entries
    5

    Default Re: Expression Gate 2

    Nice bump. -_-

Closed Thread

LinkBacks (?)


Similar Threads

  1. Expression Gate : Can't save expression
    By m0nday in forum Bug Reports
    Replies: 2
    Last Post: 08-06-2008, 12:29 PM
  2. Gate - Expression -> Gone!
    By Qvazzler in forum Installation and Malfunctions Support
    Replies: 10
    Last Post: 05-25-2007, 10:26 AM

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