+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: Clock chip

  1. #1
    Wire Noob HL-SDK's Avatar
    Join Date
    Feb 2007
    Posts
    4

    Default

    I dont like making my own clocks with a self resetting timer and a comparator. I think it'd be much more streamlined to code in a LUA clock (and by clock, I mean clock signal, not time teller)

    I'd do it, but my LUA skills are no longer what they used to be (not much).

    Anyway, super thanks! Also, the regular chips (counter, divider), I know they can be made with basic flip flops and latches, but it'd be smoother if they were in code.

    Also, instead of the gate model, an actualy IC model would be cool, where you'd click on the pins to wire them, insead of the not noob friendly system you have now.


    Other than that, fantastic mod!

  2. #2
    Wire Noob HL-SDK's Avatar
    Join Date
    Feb 2007
    Posts
    4

    Default

    I love doublepost


    Also, auto weld to the wall would be a nice feature. I dont like my stuff falling off. Thanks again!

  3. #3
    Wirererer greenarrow's Avatar
    Join Date
    Mar 2007
    Location
    UK
    Posts
    196

    Default

    I dont like making my own clocks with a self resetting timer and a comparator. I think it'd be much more streamlined to code in a LUA clock (and by clock, I mean clock signal, not time teller)

    I'd do it, but my LUA skills are no longer what they used to be (not much).

    Anyway, super thanks! Also, the regular chips (counter, divider), I know they can be made with basic flip flops and latches, but it'd be smoother if they were in code.

    Also, instead of the gate model, an actualy IC model would be cool, where you'd click on the pins to wire them, insead of the not noob friendly system you have now.
    Other than that, fantastic mod![/b]
    This is untested code so it prob wont work, but i'm away and have no gmod. Its and up down counter. Ur welcome to give it a try,
    Add it to wire\lua\weapons\gmod_tool\stools\wire_gate_memory .lua at the end of the file. Tell me if it works.
    Code:
    GateActions["udcounter"] = {
    ****group = "Memory",
    ****name = "Up/Down Counter",
    ****inputs = { "Increment", "Decrement", "Clk", "Reset"},
    ****output = function(gate, Inc, Dec, Clk, Reset)
    ****local lInc = (Inc > 0)
    ****local lDec = (Dec > 0)
    ****local lClk = (Clk > 0)
    ****local lReset = (Reset > 0)
    ****if ((gate.PrevInc ~= lInc || gate.PrevDec ~= lDec || gate.PrevClk ~= lClk) && gate.lClk) then
    ********if (lInc) and (!lDec) and (!lReset) then
    ************gate.countStore = gate.countStore + 1
    ********elseif (!lInc) and (lDec) and (!lReset) then
    ************gate.countStore = gate.countStore - 1
    ********end
    ********gate.PrevInc = lInc
    ********gate.PrevDec = lDec
    ********gate.PrevClk = lClk
    ****end
    ****if (lReset) then
    ********gate.countStore = 0
    ****end
    ****return gate.countStore
    ****end,
    ****label = function(Out, Inc, Dec, Clk, Reset)
    ********return "Increment:"..Inc.." Decrement:"..Dec.." Clk:"..Clk.." Reset:"..Reset.." = "..Out
    ****end
    }
    -----------------------------------------------
    gmod addon reviews:
    http://gmodreviews.googlepages.com/

  4. #4
    Administrator Tad2020's Avatar
    Join Date
    Feb 2007
    Location
    California, USA
    Posts
    1,498

    Default

    This is untested code so it prob wont work, but i'm away and have no gmod. Its and up down counter. Ur welcome to give it a try,
    Add it to wire\lua\weapons\gmod_tool\stools\wire_gate_memory .lua at the end of the file. Tell me if it works.[/b]
    Proper is now /autorun/wiregates.lua. If this works, i'll add it.
    "Our death ray doesn't seem to be working. I'm standing right in it, and I'm not dead yet." - Jamie Hyneman
    "Yes, managing the anonymous activity of the entire Internet is a challenge. Shoving the entire universe into a mason jar for use as a personal flashlight would also be a pesky bother." - Karl, BBR

    WIREMOD WILL NOT WORK ON YOUR FACE! BUT IT DOES ON YOUR MOM :shifty:

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

    Default

    Clock thing is actually an idea. You could set up 2 times: Frequency1 and Frequency2.
    Frequency1 - width of "1" signal, frequency2 - width of "2" signal.
    I'm a wire-crazy person with a tail.

    Take a daily journey into my brain

    D2K5

  6. #6
    Wirererer greenarrow's Avatar
    Join Date
    Mar 2007
    Location
    UK
    Posts
    196

    Default

    Proper is now /autorun/wiregates.lua. If this works, i'll add it.[/b]
    I'll test it next week and get back to you.

    Clock thing is actually an idea. You could set up 2 times: Frequency1 and Frequency2.
    Frequency1 - width of "1" signal, frequency2 - width of "2" signal.[/b]
    I don't completely follow, do you mean the on period and the off period or two seperate clocks in one chip?
    -----------------------------------------------
    gmod addon reviews:
    http://gmodreviews.googlepages.com/

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

    Default

    Code:
    _______******_______******____
    __|****** |____|****** |____|
    **^_______^************ ^__^
    ******1****************** 2
    1 is frequency1 (width of the marked area)
    2 is frequency 2 (width of the marked area)
    I'm a wire-crazy person with a tail.

    Take a daily journey into my brain

    D2K5

  8. #8
    Wirererer Qjet's Avatar
    Join Date
    Mar 2007
    Location
    Canada
    Posts
    319

    Default

    i don't see a specific application for that other then maybe a police light.

  9. #9
    Wirererer greenarrow's Avatar
    Join Date
    Mar 2007
    Location
    UK
    Posts
    196

    Default

    I've made a clock. On period and off period are settable via inputs. Again I havn't been able to test it, but next week I will have the tested version.

    Code:
    GateActions["clock"] = {
    ****group = "Time",
    ****name = "Clock",
    ****inputs = { "Run", "On Period", "Off Period" },
    ****timed = true,
    ****output = function(gate, Run, onPeriod, offPeriod)
    ****if ( Run > 0 ) then
    ********if (gate.State) then
    ************if (CurTime() >= gate.PrevTime + onPeriod) then
    ****************gate.State = false
    ****************gate.PrevTime = CurTime()
    ****************return 0
    ************else
    ****************return 1
    ************end
    ********else
    ************if (CurTime() >= gate.PrevTime + offPeriod) then
    ****************gate.State = true
    ****************gate.PrevTime = CurTime()
    ****************return 1
    ************else
    ****************return 0
    ************end
    ********end
    ****end
    ****return 0
    ****end,
    ****label = function(Out, Run)
    ********return "Run:"..Run.." = "..Out
    ****end
    }
    -----------------------------------------------
    gmod addon reviews:
    http://gmodreviews.googlepages.com/

  10. #10
    Wirererer XeonXT's Avatar
    Join Date
    Mar 2007
    Posts
    199

    Default

    Clock thing is actually an idea. You could set up 2 times: Frequency1 and Frequency2.
    Frequency1 - width of "1" signal, frequency2 - width of "2" signal.[/b]
    What in teh fucx are you talking about? Does that have anything to do with a clock chip...?

    Anyway I think this is a good idea but all it really takes is 3 chips (time, greater, value) to make atm. Not a huge timesaver.
    "As far as I can remember, Garry has always had this pissy, elitist attitude towards others. "I'm better than you all." That's his philosophy. And that's why he's hated. If he had been nice and respectful in the first place, he wouldn't have a bunch of pissed-off enemies biting at his ass every chance they get."

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. I just have a Clock Button
    By s.kko in forum Installation and Malfunctions Support
    Replies: 13
    Last Post: 06-14-2009, 05:08 PM
  2. Binary Clock with CPU
    By Aut in forum Finished contraptions
    Replies: 7
    Last Post: 12-06-2008, 08:54 AM
  3. Working clock
    By Mp6 in forum Finished contraptions
    Replies: 5
    Last Post: 12-24-2007, 12:12 AM
  4. 12 Hour Clock
    By bones3 in forum Gate Nostalgia (Old School Wiring) Discussion & Help
    Replies: 1
    Last Post: 11-21-2007, 04:39 PM
  5. Binary Clock?
    By timas in forum Installation and Malfunctions Support
    Replies: 3
    Last Post: 05-12-2007, 11:30 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