Ruby Counter

For general discussion related FlowStone
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Ruby Counter

Post by billv »

I thought it would be good if had a "standard" Ruby Counter,
that everyone can use and modify straight away.
This is what i got so far. Not much, but it works.
Ruby Counter.fsm
(3.58 KiB) Downloaded 1415 times

I'd like to start with a re-set trigger. I can't work it out yet...keep failing.
tester
Posts: 1786
Joined: Wed Jan 18, 2012 10:52 pm
Location: Poland, internet

Re: Ruby Counter

Post by tester »

Tried with timer/delay after afterload?
Need to take a break? I have something right for you.
Feel free to donate. Thank you for your contribution.
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Re: Ruby Counter

Post by billv »

not yet.tried lots of things...its really fun to fail at this.
Learning heaps but nothing i try works :lol:
next attempt in 12 hours...bummer..
User avatar
nix
Posts: 817
Joined: Tue Jul 13, 2010 10:51 am

Re: Ruby Counter

Post by nix »

That is the same result I can get.
We are calling Ruby time.
I decided to make a tick counter instead, with my homebrew seq method.
Hopefully trog might pop in here and shed some light on this.
The current counter u have made gives the time since the Ruby component is turned on I think.
All success
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Re: Ruby Counter

Post by billv »

nix wrote:decided to make a tick counter instead, with my homebrew seq

Yeh I somehow missed it, or forgot it, but it's doing the trick for me at the moment.
The homebrew seq is great man...I'm always using it, to check something or to pull something out :D
A great "playground" for ruby noobs to cut their teeth...
I know you've taken it underground, but if it dosn't work out there, seriously consider
expanding the whole thing and turning it into a massive "tweakable" tutorial. :idea: :)
User avatar
tektoog
Posts: 141
Joined: Sat Oct 30, 2010 11:49 pm
Location: Geneva - Switzerland

Re: Ruby Counter

Post by tektoog »

I have this...

TekTooG - RUBY Counter reset 01.fsm
(2.32 KiB) Downloaded 1408 times

Not sure it suits your needs...
"Essential random order for chaotic repetitive sequences"
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Re: Ruby Counter

Post by billv »

tektoog wrote:Not sure it suits your needs...

Thanks mate. Unfortunatly, no, it dosn't suit, as your cheating... :lol: :lol: :lol:
ScreenShot208.png
ScreenShot208.png (13.26 KiB) Viewed 29564 times

The general Plan is for a ruby module with in's/out's like these.
ScreenShot209.png
ScreenShot209.png (6.47 KiB) Viewed 29564 times


I don't mind spending the next 6 months, chipping away at this..... all good...great fun
It's just that a "counter" is a "crucial" building block, and i thought it might be better
to create it faster, so people can get on with more important stuff.

But yeh, I'm enjoying it. Spent another hour yesterday failing, trying from other perspectives.
I'll get it one day.
Good entertainment for the "Ruby guru's" as well, watching a ruby noob struggle with 1+1=2. :lol:
User avatar
tektoog
Posts: 141
Joined: Sat Oct 30, 2010 11:49 pm
Location: Geneva - Switzerland

Re: Ruby Counter

Post by tektoog »

billv wrote:it dosn't suit, as your cheating...

Hehe, ok...
I wasn't sure if it was a "total ruby counter" you were after...
now, I know! :)
I'll try to get in if I can...
"Essential random order for chaotic repetitive sequences"
billv
Posts: 1165
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia
Contact:

Re: Ruby Counter

Post by billv »

tektoog wrote:I'll try to get in if I can..

Cheers mate. don't sweat it. No real hurry.

It's just so weird. I got a signal going in, and all i want to do is stick a number on each signal.
And I still can't do it.... :lol: :lol:
I'm glad I've got Nix's example, which clearly shows a method that semms to work, so i can work of
that a bit.
It's just real dissapointing I still can't work out how to do it on my own.

I think it's best if i maybe fork out some cash for a few lessons by a pro tutor or something.
Cause it's just not happening here. The skills i picked up doing visual basic a few years back
are not returning and i'm sick of waiting for them to turn up :D
The learning curve is just too much at the moment........hhhhhmmmmmmm
User avatar
trogluddite
Posts: 1730
Joined: Fri Oct 22, 2010 12:46 am
Location: Yorkshire, UK

Re: Ruby Counter

Post by trogluddite »

Here's a counter that should cover most bases...
Ruby Counter.fsm
(3.88 KiB) Downloaded 1423 times

...it's not necessarily the most efficient code - but written with lots of comments that will hopefully make it useful to learn from.

One little note of caution though...
If you are working entirely with 'green' inputs/outputs, a Ruby based counter like this one may not be the best solution. The stock counters will be super-fast compiled 'C' routines, whereas Ruby has to run in its interpreter - so it's probably best to carry on using the old ones, unless your schematic has special requirements that need extra features.
All schematics/modules I post are free for all to use - but a credit is always polite!
Don't stagnate, mutate to create!
Post Reply