Ruby LED Sign Service

A

Aaron Patterson

I just released a new version of my BetaBrite sign library, and I
decided it would be neat if I had a service so that people could try out
the library.

I've created a DRb service that lets you write to my BetaBrite LED sign
and take a photo of it. The service has 3 methods, "write_simple" which
just takes a string and writes it to the sign, "write" which takes a
BetaBrite::String and writes it, and "take_photo" that returns a photo
of the sign. Both methods that write to the sign will also return a
photo of the sign.

Here's a simple example:

require 'drb'
require 'rubygems'
require 'betabrite'

DRb.start_service()
obj = DRbObject.new(nil, 'druby://eviladmins.org:9000')

File.open("out.jpg", 'wb') { |a|
a.write obj.write_simple("Seattle.rb")
}

There are, of course, a few caveats... First, if the message you create
is too long, it will scroll. I have a crappy webcam, so scrolling
messages won't look very good. I haven't done much error checking in
the server, so please be nice. I could shut this thing down at any
time, I don't guarantee that my server is up, and as always YMMV, etc.

For a slightly more complicated example and a sample photo, check out my blog
entry:
http://tenderlovemaking.com/2006/09/28/new-ruby-betabrite-002/

Hope everyone likes it!
 
P

Pawel Szymczykowski

I just released a new version of my BetaBrite sign library, and I
decided it would be neat if I had a service so that people could try out
the library.

That is one of the niftiest things ever! I wonder if it will work from
tryruby too.

Good job on that - I've always wanted to get one of those led signs to
scroll rss feeds / server uptimes etc. Now it seems like it would be
super easy to do. :)

-Pawel
 
D

Dr Nic

File.open("out.jpg", 'wb') { |a|
a.write obj.write_simple("Dr Nic")
}

Damn my corporate firewall. I want my own "DR NIC" sign! I shall try
from home tonight!
 
B

Bil Kleb

Dr said:
Damn my corporate firewall. I want my own "DR NIC" sign! I shall try
from home tonight!

Ditto:

Errno::ECONNREFUSED: Connection refused - connect(2)> (DRb::DRbConnError)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,181
Messages
2,570,970
Members
47,537
Latest member
BellCorone

Latest Threads

Top