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
Basic loop on Ruby
7 posts
• Page 1 of 1
Basic loop on Ruby
Hello, my simle code on ruby not work in flowstone, but work on Ruby language.
a = 1
b = 2
c = 3
loop do
puts a
sleep 1
puts b
sleep 1
puts c
sleep 1
end
original
flowstone
a = 1
b = 2
c = 3
loop do
output a
sleep 1
output b
sleep 1
puts c
output c
end
All die... FL crash....
trying to write a simple sequence generator
Method Sleep kill ruby.
a = 1
b = 2
c = 3
loop do
puts a
sleep 1
puts b
sleep 1
puts c
sleep 1
end
original
flowstone
a = 1
b = 2
c = 3
loop do
output a
sleep 1
output b
sleep 1
puts c
output c
end
All die... FL crash....
trying to write a simple sequence generator
Method Sleep kill ruby.
- borodadada
- Posts: 47
- Joined: Sun Jun 02, 2013 5:58 pm
Re: Basic loop on Ruby
afaik sleep dont work here in fs, but you can try to use time.. to delay the the output..
or you use an array with you values an read the index with a timed counter..
or you use an array with you values an read the index with a timed counter..
-
Nubeat7 - Posts: 1347
- Joined: Sat Apr 14, 2012 9:59 am
- Location: Vienna
Re: Basic loop on Ruby
time - FlowStone? or standart ruby class?
I have a task to build an infinite loop that would print the value of variable intervals.
I have a task to build an infinite loop that would print the value of variable intervals.
- borodadada
- Posts: 47
- Joined: Sun Jun 02, 2013 5:58 pm
Re: Basic loop on Ruby
so a,b & c are changing constantly and you want to read them every second ? maybe you could post a schematic to see what you want exactly
if you use the event method you can use time, just watch the userguide, and there is also a ruby ticker in the toolbox where you can choose variable ticking time..
if you use the event method you can use time, just watch the userguide, and there is also a ruby ticker in the toolbox where you can choose variable ticking time..
-
Nubeat7 - Posts: 1347
- Joined: Sat Apr 14, 2012 9:59 am
- Location: Vienna
Re: Basic loop on Ruby
if start ruby language
a = 1
b = 2
c = 3
loop do
puts a
sleep 1
puts b
sleep 1
puts c
sleep 1
end
resultat
1
2
3
1
2
3
..... + pause, infinite
I need exactly the same effect
I have a module that I need to constantly send information cycle, the size may be different, which will show itself, and I can not understand how can implement.
ticker module, but it sends a true or false.
bad in that Ruby can not write cycles ...
a = 1
b = 2
c = 3
loop do
puts a
sleep 1
puts b
sleep 1
puts c
sleep 1
end
resultat
1
2
3
1
2
3
..... + pause, infinite
I need exactly the same effect
I have a module that I need to constantly send information cycle, the size may be different, which will show itself, and I can not understand how can implement.
ticker module, but it sends a true or false.
bad in that Ruby can not write cycles ...
- borodadada
- Posts: 47
- Joined: Sun Jun 02, 2013 5:58 pm
Re: Basic loop on Ruby
Here is a small example for timed events. That's the FS way to do "sleep"
- Attachments
-
- timed loop (MyCo).fsm
- (441 Bytes) Downloaded 1124 times
-
MyCo - Posts: 718
- Joined: Tue Jul 13, 2010 12:33 pm
- Location: Germany
Re: Basic loop on Ruby
thank you it works! I would like to in the future, more similar to the Ruby language
- borodadada
- Posts: 47
- Joined: Sun Jun 02, 2013 5:58 pm
7 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 121 guests