What do you mean it flips only once? I set an interval!Just a little flaw Core Xii, it would only flip once (first() -> ...[/b]
What do you mean it flips only once? I set an interval!Just a little flaw Core Xii, it would only flip once (first() -> ...[/b]
Grammar is the difference between [i]"helping your uncle, Jack, off his horse"[/i] and [i]"helping your uncle jack off his horse".[/i]
"interval" is not "set interval", it is merely a different version of schedule which makes sure that it is run at the specified rate (if rescheduled over and over again) and that it doesn't reschedule previous schedules, but wait for them to finish.What do you mean it flips only once? I set an interval![/b]
Basically, interval remembers the exact time the last pulse should've occured and uses that as an offset for next pulse, instead of the current time, this allows you to do interval(20) and be sure that it actually runs 50 times per second and does not fall behind.
Perhaps bad naming.
As far as the documentation is concerned, interval(1000) should keep triggering clk() every 1000 ms when you call the function.Originally posted by documentation
Instead of specifying a frequency, you schedule when the next clock pulse should occur using "schedule(50)", which will cause the next clock pulse to occur in 50 milliseconds. To continually keep it executing as it would with an external pulser use "interval(50)" instead and put it at the top of the expression, this function has basically the same functionality as schedule, however it does not override previously scheduled clock pulses, instead it just ignores the call.
So the way I understood it,
triggers clk() once in ms milliseconds, andCode:schedule(ms)
keeps triggering clk() in ms millisecond intervals.Code:interval(ms)
Did I miss something? You better rephrase how exactly interval() works.
So actually, I'd just write it like this:
And according to your documentation, that should work.Code:O@Out interval(1000) clk() -> Out = !Out;
Grammar is the difference between [i]"helping your uncle, Jack, off his horse"[/i] and [i]"helping your uncle jack off his horse".[/i]
Yes it works like you wrote there
But in your last example you put "first() -> interval(1000);", which would cause it to only execute once.
I realize that it is a badly worded, but:
"To continually keep it executing as it would with an external pulser use "interval(50)" instead and put it at the top of the expression."
Just like you did now, I might rephrase is later today.
The syntax is misleading - interval(ms) looks like a function.
Something like...
or something similar would make more sense.Code:N@Name I@Input O@Output interval@1000
Grammar is the difference between [i]"helping your uncle, Jack, off his horse"[/i] and [i]"helping your uncle jack off his horse".[/i]
Well, interval(ms) is a function, it schedules one clock pulse to happen soon.The syntax is misleading - interval(ms) looks like a function.
Something like...
or something similar would make more sense.[/b]Code:N@Name I@Input O@Output interval@1000
interval@1000 would in my opinion add further confusion because you would then assume that it automatically schedules intervals (which is does not), and add the confusion of what is that, why does it look so funny. And I would not add new language constructs for something that really is a function.
But I've been working alot with programming too so I guess we have somewhat different views.
Okay.. how wold one make an internal clock which
counted up to X if A is true, else it counts down to 0.
oh yeah. Syn. SOmethign odd going on with the Mux Demux stuff. I had a script working fine and then added one more mux and demux into it and it stopped working right and just did stupid stuff like a never ending climbing number.
What kind of a function is one you must put at the top?Well, interval(ms) is a function[/b]
I mean, it would make sense if it was a function to initialize a system the other functions were dependent of, but it doesn't quite look like one to me.
Grammar is the difference between [i]"helping your uncle, Jack, off his horse"[/i] and [i]"helping your uncle jack off his horse".[/i]
Bookmarks