+ Reply to Thread
Results 1 to 3 of 3

Thread: Tools : Expression Chip Script : Dual Input Series

  1. #1
    Wire Amateur XeononyX's Avatar
    Join Date
    Mar 2007
    Location
    Kansas, USA
    Posts
    63

    Default

    I designed these 2 chips at the same time and to save forum readers I combined these two scripts into one post.

    First I have the Dual Input Counter:

    Code:
    N@Dual Input Counter
    I@Pos Neg Set Reset Rate Min Max
    O@Out
    LIMIT=Max>Min
    !Rate -> Rate=1;
    Pos -> Out += Rate;
    Neg -> Out += Rate*-1;
    Set -> Out=Set;
    Reset -> Out=0;
    Out < Min & LIMIT -> Out = Min;
    Out > Max & LIMIT -> Out = Max;
    Pretty much what this does is effectively keep an active counter with some customizable controls. I will explain input by input:

    Pos -> This is the trigger to increment the counter.
    Neg -> This is the trigger to decrement the counter.
    Set -> This is a special trigger to set the value to what you desire.
    Reset -> Simply triggers the counter to zero.
    Rate -> This is a value to tell the chip at what rate to change.
    Min -> The minimum floor for the counter if the limit is activated.
    Max -> The maximum ceiling for the counter if the limit is activated.

    There is no rate of zero: so if the chip sees a rate of zero it defaults it to one.
    If the Maximum is greater than the Minimum then the limit is activated. So that means if you do not designate a Min and Max both are zero so there is no limit. If you designate a MAX of 10 and no Min then the chip reads the max greater than the min and only allows values between 0 and 10 even if a set, pos, neg, or reset triggers it out of bounds: it will automatically set it to the corresponding min or max.

    Thats chip number one and works great with my beloved pod controls. Now with the next one:

    The Dual Input 10 Port Data Table:

    Code:
    N@10 Port Data Table
    I@Pos Neg Set Reset Max Data0 Data1 Data2 Data3 Data4 Data5 Data6 Data7 Data8 Data9
    O@Index Output
    !Max -> Max=9;
    Index & Neg -> Index += -1;
    Index < Max & Pos -> Index += 1;
    Set -> Index=Set;
    Reset -> Index=0;
    !Index -> Output=Data0;
    Index==1 -> Output=Data1;
    Index==2 -> Output=Data2;
    Index==3 -> Output=Data3;
    Index==4 -> Output=Data4;
    Index==5 -> Output=Data5;
    Index==6 -> Output=Data6;
    Index==7 -> Output=Data7;
    Index==8 -> Output=Data8;
    Index==9 -> Output=Data9;
    Very similar to the other chip this is is more confined and has a considerable less amout of &#39;play&#39; when it comes to the counting range. The range is only from 0-9 but each "index" has a special "data" port assigned to it. I&#39;ll first explain the inputs and outputs:

    Pos -> This is the trigger to increment the index.
    Neg -> This is the trigger to decrement the index.
    Set -> This is a special trigger to set the index to what you desire.
    Reset -> Simply triggers the index to zero.
    Max -> The maximum ceiling for the index when using the Pos trigger.
    Data0-Data9 -> The corresponding outputs you desire to link with their index.

    Index -> The index the datatable is pointing at.
    Output -> The corresponding data for the index from the data ports.

    The absense of Min and Rate are not a mistake, simply they would rarely be used.
    The chip defaults the Max to 9 if it reads 0. The Max is only for the positive increment trigger. This is intentional (maybe for a secret level on an elevator only accessable if you type in the right code .. just a thought).
    whew! I know it sounds difficult but once you use it once you&#39;ll understand it.

    If this really boggles ya I&#39;ll help you out. I have an advanced duplicator save of a mean etch-o-sketch using 2 dual input counters, 2 constants, a memory toggle chip, a digital screen, a small tv screen, an indicator, and a pod controller. If you download the save you will need PHX, and wiremod with the expression chip. Also theres a small bug: for some reason you have to "re-link" the pod controls to use it. Also save as.. when saving .. its a text file (sorry no screenshot yet)
    <div align="center"></div>

  2. #2
    That furred thing Black Phoenix's Avatar
    Join Date
    Feb 2007
    Location
    Kyiv, Ukraine
    Posts
    3,565

    Default

    Stop adding tags to your topics, it kinda annoys

    This is useful tho (you know, you coulda have used smoother for that)
    I'm a wire-crazy person with a tail.

    Take a daily journey into my brain

    D2K5

  3. #3
    Wire Amateur XeononyX's Avatar
    Join Date
    Mar 2007
    Location
    Kansas, USA
    Posts
    63

    Default

    I agree. Thats why I aded the ps. But I&#39;m not understanding what I could of used a smoother for though.
    <div align="center"></div>

+ Reply to Thread

Similar Threads

  1. Expression Chip 2 and Cpu Chip aint working
    By bradmcco in forum Installation and Malfunctions Support
    Replies: 1
    Last Post: 01-19-2009, 07:53 AM
  2. Wired Numerator Input Chip?
    By ins in forum Ideas & Suggestions
    Replies: 9
    Last Post: 11-26-2007, 01:14 PM
  3. Demo : Expression (BETA 3) Chip Script : XY Turret
    By XeononyX in forum Gate Nostalgia (Old School Wiring) Discussion & Help
    Replies: 9
    Last Post: 05-05-2007, 09:00 PM
  4. Tool : Expression (BETA 3) Chip Script : 10 port pod control
    By XeononyX in forum Gate Nostalgia (Old School Wiring) Discussion & Help
    Replies: 3
    Last Post: 04-10-2007, 07:57 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