Ruby Counter

For general discussion related FlowStone
fixstuff555
Posts: 151
Joined: Thu Oct 21, 2010 3:24 pm

Re: Ruby Counter

Post by fixstuff555 »

Love the comments Trog, wonderful learning tool.
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Ruby Counter

Post 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.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Re: Ruby Counter

Post by billv »

trogluddite wrote:Here's a counter that should cover most bases...

:o Awesome....only had time for a quick look.....
fixstuff555 wrote:wonderful learning tool.

...yeh, it looks that way :) ....Thanks Trog.
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Re: Ruby Counter

Post 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.....
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Ruby Counter

Post 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! :lol:
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Re: Ruby Counter

Post 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 :lol: :lol:
..na, keep it...you've already given us noobs a 'smorgasbord" in that FSM...
pall
Posts: 31
Joined: Thu Dec 09, 2010 1:27 pm
Location: Transilvania
Contact:

Re: Ruby Counter

Post by pall »

Finally born a ruby counter. ;)
Thank Trog!
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Re: Ruby Counter

Post 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 :?
Count Redraw problem.fsm
(74.11 KiB) Downloaded 1183 times
User avatar
Nubeat7
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna
Contact:

Re: Ruby Counter

Post 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..
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Re: Ruby Counter

Post 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.
Post Reply