If you have a problem or need to report a bug please email :

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

3-Color Dynamic LED Switch

Post any examples or modules that you want to share here

3-Color Dynamic LED Switch

Postby pwesynthmaker » Sat Mar 26, 2022 2:46 pm

My 'almost-all-my-very-own ruby code' .fsm schematic.
A LED switch with 3-colored 'dynamic' text and 'float' value input/output.
Download Link: ...

Here is the Ruby Code:


# ledsw32pxmultilbl ruby code

def draw v

# Calculate the rect to draw the text inside
# Rectangle width & height = relative to font size w/word wrap
# + led diam
rect1 = [0,-3.5,v.width,v.height]
rect2 = [0,0.75,v.width,v.height]
rect3 = [0,4,v.width,v.height]

# Setup font1 and alignment
font1 = "Arial",1.75,"bold"
sf1 =
sf1.setAlignment "center"
sf1.setLineAlignment "center"

# Draw the label
v.drawString @label1,font1,sf1,rect1,( @color1)

# Setup font2 and alignment
font2 = "Arial",1.75,"bold"
sf2 =
sf2.setAlignment "center"
sf2.setLineAlignment "center"

# Draw the label
v.drawString @label2,font2,sf2,rect2,( @color2)

# Setup font3 and alignment
font3 = "Arial",1.75,"bold"
sf3 =
sf3.setAlignment "center"
sf3.setLineAlignment "center"

# Draw the label
v.drawString @label3,font3,sf3,rect3,( @color3)


def event i,v
redraw 0

3colorubysw.jpg (35.47 KiB) Viewed 1459 times ... fstone.htm
Inventor eFX Technology FlowStone WebPage
Inventor eFX Technology
Username: viewer
Password: #1Password
User avatar
Posts: 65
Joined: Fri Feb 12, 2016 7:18 pm

Return to User Examples

Who is online

Users browsing this forum: No registered users and 9 guests