If you have a problem or need to report a bug please email : support@dsprobotics.com
There are 3 sections to this support area:
DOWNLOADS: access to product manuals, support files and drivers
HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects
USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here
NEW REGISTRATIONS - please contact us if you wish to register on the forum
Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright
Simple Ruby problem
4 posts
• Page 1 of 1
Simple Ruby problem
I'm having a go at turning my green counting systems over to ruby,
but stuck with a some real simple logic.
This code gets me a trigger on each count.....???
I know I'm probably still thinking "Visual basic".... but i just don't get it .
If the value is =1 then give me a trigger.....seems a very straightforward instruction....
What am i missing here.....
but stuck with a some real simple logic.
- Code: Select all
def event i,v,t
if v = 1 then output 0,t
end
end
This code gets me a trigger on each count.....???
I know I'm probably still thinking "Visual basic".... but i just don't get it .
If the value is =1 then give me a trigger.....seems a very straightforward instruction....
What am i missing here.....
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
Re: Simple Ruby problem
you couud also write just
so you dont need an event (if it just should do that..)
- Code: Select all
output nil if @in == 1
so you dont need an event (if it just should do that..)
-
Nubeat7 - Posts: 1347
- Joined: Sat Apr 14, 2012 9:59 am
- Location: Vienna
Re: Simple Ruby problem
Thanks guys....should have worked it out....nix showed me a good example of (==) a while
back in a on/off switch..I've been using it all the time as well....
This is great.....now I've got some control in ruby....
Thanks.
back in a on/off switch..I've been using it all the time as well....
This is great.....now I've got some control in ruby....
Thanks.
BV MUSIC SYDNEY AUSTRALIA..Songwriting and Software development
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
Headquartershttps://www.bvmusicsydneyaustralia.com/
Spotifyhttps://open.spotify.com/artist/7JO8QM40mVmHb7pAwKPJi0
Donatationhttps://www.paypal.com/donate/?hosted_button_id=HEUR8R7K8GZ4L
- billv
- Posts: 1157
- Joined: Tue Aug 31, 2010 3:34 pm
- Location: Australia
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 101 guests