Page 2 of 4
Re: Ruby Counter
Posted: Mon Apr 29, 2013 1:42 am
by fixstuff555
Love the comments Trog, wonderful learning tool.
Re: Ruby Counter
Posted: Mon Apr 29, 2013 2:40 am
by trogluddite
Thanks a lot, fixstuff - glad to know it is helpful.
Think I might do a few more like that - maybe easier to have it in a working schematic instead of long forum posts.
Re: Ruby Counter
Posted: Mon Apr 29, 2013 5:58 am
by billv
trogluddite wrote:Here's a counter that should cover most bases...

Awesome....only had time for a quick look.....
fixstuff555 wrote:wonderful learning tool.
...yeh, it looks that way

....Thanks Trog.
Re: Ruby Counter
Posted: Mon Apr 29, 2013 8:15 am
by billv
Had a closer look now...it's beautifully laid out and explained. Thanks again trog.
I love this part
Code: Select all
def init
@count = 0
@old_count = 0
end
Lots of my attempts kept going back to that area(def init).
At the moment, the first revelation i got was you can keep going with this
and keep defining "pre-existing" behaviours.
Code: Select all
def setup
@count = limit(@reset_value, @min, @max)
end
"Def this", "def that"...before you do the "def event"....cool....
i could see that was required, if i wanted a reset to happen, I would have to write
a "sub" program of some sort, to initialize the main code that would be running.
At the moment 99% of your tutorial is alien to my brain.
So I'm going to leave the tutorial, and take this little "crumb" of info, and milk it.......
When i come up empty-the other 99% still there to fall back on
What's that U2 song, "Waiting on the crumbs from your table"..........
Cheers mate.....
Re: Ruby Counter
Posted: Mon Apr 29, 2013 8:57 am
by trogluddite
Thanks for the kind words,guys, you are most welcome.
billv wrote:"Waiting on the crumbs from your table".
Well, now that a look away from the screen, my PC desk sure could do with a sweep - hope you like fig rolls!

Re: Ruby Counter
Posted: Mon Apr 29, 2013 12:06 pm
by billv
trogluddite wrote:hope you like fig rolls!
Is it fresh, or is it one of those pieces of food you find lying around the CPU
that you thought you had eaten a few days ago
..na, keep it...you've already given us noobs a 'smorgasbord" in that FSM...
Re: Ruby Counter
Posted: Mon Apr 29, 2013 7:51 pm
by pall
Finally born a ruby counter.
Thank Trog!
Re: Ruby Counter
Posted: Sat May 11, 2013 10:14 pm
by billv
Counter won't re-set.
Trigger is bool to false from stop/start button.
Trigger works, but no re-set to "0" happens.
Circuit and settings in counter seem fine
Can't work it out
Re: Ruby Counter
Posted: Sat May 11, 2013 11:22 pm
by Nubeat7
output 3 in ticker is time but i think it should be nil to send a trigger when state changes to false, and it does the reset but you putted a trigger switch on the output which is the reason that you don`t get it..
Re: Ruby Counter
Posted: Sun May 12, 2013 12:33 am
by billv
Nubeat7 wrote:you putted a trigger switch on the output which is the reason
Thanks mate. i just took it off and it re-sets fine.......
Not sure why i have a trigger switch in their yet

, built it some time ago..will start again with it.
Cheers.