Page 1 of 4

Ruby Counter

Posted: Fri Apr 26, 2013 11:27 pm
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.

Re: Ruby Counter

Posted: Fri Apr 26, 2013 11:50 pm
by tester
Tried with timer/delay after afterload?

Re: Ruby Counter

Posted: Sat Apr 27, 2013 12:11 am
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..

Re: Ruby Counter

Posted: Sat Apr 27, 2013 12:45 am
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

Re: Ruby Counter

Posted: Sat Apr 27, 2013 2:29 pm
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: :)

Re: Ruby Counter

Posted: Sat Apr 27, 2013 4:42 pm
by tektoog
I have this...

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

Not sure it suits your needs...

Re: Ruby Counter

Posted: Sat Apr 27, 2013 8:56 pm
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 29568 times

The general Plan is for a ruby module with in's/out's like these.
ScreenShot209.png
ScreenShot209.png (6.47 KiB) Viewed 29568 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:

Re: Ruby Counter

Posted: Sat Apr 27, 2013 11:12 pm
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...

Re: Ruby Counter

Posted: Sun Apr 28, 2013 7:49 am
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

Re: Ruby Counter

Posted: Sun Apr 28, 2013 2:29 pm
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.