|
|
Comments and Discussions
|
|
 |
|
|

|
Jeff,
I'm hoping to use your BetaBrite code significantly in a script I'm writing for Homeseer (www.Homeseer.com). Once finished, I want to post it for other Homeseer users. I don't intend to sell it, but rather just allow people to download it and I will support them with any problems they have. I also plan to point to this article in the credits with your name.
I'm assuming that there is no issue in my doing this?
Steve
|
|
|
|

|
Thanks to the information from this project, the betabriteusb.dll and the Alpha Protocol Document I have been able to program the Prism pretty much the same way I have been programming BetaBrite Classic displays. The one thing I'm still struggling with is writing Small Dots pictures. I can write them the same way I can also write them on the classic displays, but I can't get the additional colors to work. The version of the "Alpha Sign Communication Protocol" (pn 97088061, Rev F, March 2006) currently available online does not document the additional colors of the Prism display. The 'Write SMALL DOTS PICTURE' packet only supports colors from "0" to "8" (0x30 to 0x38) for pixels, i.e. black to yellow, just like for the classic displays. Other values are interpreted as black pixels.
I used the IR remote to create 7x80 DOTS Graphic with pixels of all possible colors, and used the "Read SMALL DOTS PICTURE" command to read the picture back to the PC. From the received packet it is apparent that the values for the Prism colors are the following:
30 31 32 33 34 35 36 37 38 64 60 74 70 76 72 69 65 68 4c 7d 7a 7b 7e 79 78 7f
where 30 is red and 7f is pink. However, when I send a picture using these colors, only values from 30 to 38 are accepted and any other values are ignored. They are turned in to 00, which I confirmed by reading the picture back.
I seem to be missing something, obviously, but I can't seem to find what that is using the Alpha Sign Communication Protocol documentation.
I did find a post on the ams-i forums that talks about how to use additional colors for TEXT messages, using <1C> "Z" and then 3 RGB values, which seem to indicate that the Prism implements at least part of the Alpha 3.0 protocol). However, I couldn't find any information regarding additional colors in pictures.
I was hoping that there is a newer version of the protocol documentation that specifically discusses the additional features the Prism display has over the classic displays, and that someone reading this is able to point me to where I can obtain such documentation.
|
|
|
|

|
do you have the sample code at all I am looking for this dll and code that everyone is talking about but the ftp site is down. I am looking at porting some of it to C# so I can use it in a few products, but I am looking at sending rgb colors to the display. Could you post or email me the code that you have been using for getting these extra colors.
Thanks
Brian
|
|
|
|

|
You can download the dll from here:
http://www.industrologic.com/prissoft.htm
There is also a demo program in basic that demonstrates how to use it.
It is not possible, to send Small Dot picture files with more than the 8 standard colors. I've tried. However, it is possible to send regular text using RGB colors. Send the command code 0x1C followed by "ZRRGGBB" to change the text color and "1CH" followed by "YRRGGBB" to change the shade color. The prism can reproduce the following 64 colors:
RGB values in hexadecimal:
Red - FF0000
Dim Red - 400000
Green - 00FF00
Dim Green - 004000
Amber - FFFF00
Brown - 404000
Orange - F04000
Yellow - 40FF00
Blue - 0000FF
Dim Blue - 000040
Aqua - 00FFFF
Light Cyan - 00FF40
Cyan - 0040FF
Light Cyan - 004040
Magenta - FF0040
Purple - 8000FF
Light Purple - 400040
Violet - 400080
Light Violet - FF40FF
Redish White - FFFF40
Full White - FFFFFF
Blueish White - 40FFFF
White - 40FF40
Grey - 404040
Pink - FF4040
E.g. to set the text color to blue, send the character 0x1C, the character "Z", and then 6 characters representing the RGB value in hex, i.e. "0000FF"
The individual bytes for R, G, and B can not assume arbitrary values. They can only be "00", "40", "80", or "C0". (Note that the Adaptive Micro Systems program uses the value FF rather than C0. Both produce the same color result.)
|
|
|
|

|
It's been ages since I've done any BetaBrite programming, but one thing I found is that attempting to edit a stored message or string will disrupt the display, but the sign supports programmable macros which can be changed without disrupting the display. One is unfortunately limited in what one can do with macros (IIRC, they can contain font-change commands, but not end-of-line or transition commands), but they nonetheless provide a useful way to have text that will change 'smoothly' in response to external stimuli.
|
|
|
|

|
Can you elaborate on how this works?
|
|
|
|

|
i have one but dont know how to program it please help.... when i open my store it came with ..
|
|
|
|

|
Guys,
With some guess work and scratching around, I have managed to port this code to the new version of the betabrite, the Prism (USB) with working RGB colors.
The hurdle was working out the P/Invoke required to the sign running with an unsupported dll I found on the homeseer forums, then porting it to Jeff’s excellent Protocol class was easy.
Once I have it tidied up a bit I will post it, if you want the code now in it's current incarnation send me a message Andrew (at) stonie.net
Cheers,
Stonie.
modified on Sunday, February 10, 2008 5:24 PM
|
|
|
|
|

|
It says that I don't have the right privileges. Is there another place to the grab code from?
|
|
|
|

|
Try again now
|
|
|
|

|
Much better, thanks a bunch!
|
|
|
|

|
I have one of these signs and it came with no cable or software. I found the link to build the cable but I dont know nothing about .net and VB. Can someone please help by pointing me in the right direction to using this pages code?
Remember I dont know VB
Thank You
|
|
|
|

|
Greetings:
I have converted this to .net 2.0 and am receiving the following error:
'CommandCode' cannot expose type 'CommandCode' in namespace 'BetaBrite' through class 'BaseCommand'.
Any ideas on what I need to do to resolve this?
Thanks
|
|
|
|

|
To work around it, you can mark CommandCode Enum as public (instead of protected)
Hope this helps,
Stonie.
|
|
|
|

|
Acutally, you should change:
Protected Enum CommandCode
to
Public Enum Commandcode
|
|
|
|

|
Public Open method in Sign class re-instantiates BetaBrite.RS232 resetting port to 1 (by field initializer). That is the library does not work with COM ports other then 1.
Did I miss something?
Regards,
Roman
|
|
|
|

|
You are missing a .bmp file in your latest posting of the demo source code. Would you please re-post with this file? Thank you.
|
|
|
|
|

|
hei - I know the post i old, but the image files seems to have gone missing again. Any chance of re-posting?
/Sune
|
|
|
|

|
so here's the deal i have a single line beta brite sign.
i really love it, and i want to do more with the sign(i'm currently developing an application for my store, we rent dvd, vhs, games, and also do instore gaming) from my application,
but......
i bought the sign from sam's club and to my surpise it came without software. all attempts to d/l anything from the web site only gets me demos.
does anyone have a copy of the disk that they would be willing to send to me?
this is completely legit.
thanx for your help.
Dave Jr.
|
|
|
|

|
First off, I'd like to say that you've done a tremendous job with this code. It works really well, and I've used it to great effect with my BetaBrite sign.
I do have a problem with your bitmap handling, though, specifically in the WritePictureFileCommand class. You never call Dispose() on the Bitmap object that you create. I wrote a web interface which allows people to draw on my sign, and I have to take their drawing, save it to a file, then feed the file to your code. I'd like to be able to delete the file afterward, but I can't because your internal Bitmap object is still using it. I think a more flexible design might be for your class to take a Bitmap object instead of a file path. That way, people could be responsible for their own resource cleanup, and I'd be able to create an in-memory Bitmap object and feed it to your sign without the in-between step of having to save it to a file.
Anyway, apart from that, it's great work. Nicely done.
|
|
|
|

|
Well, it's not wrong per se-- the web context just holds on to the reference a lot longer than a console or winforms app would. You need the resource released faster in a web environment. Which is no problem! Just modify the Sign.SetPicture method as follows:
Dim pc As New WritePictureFileCommand(fileLabel, filename)
SendCommand(pc)
pc = Nothing
that pc = Nothing line should release the bitmap object immediately after it is sent.
I agree we should add an overloaded method which accepts a Bitmap object, in addition to the filename, so you can avoid the filesystem step entirely. I'll do that.
I'm interested to see your web interface, too!
|
|
|
|

|
I don't want to quibble over semantics here (actually, I just like using the word "quibble"), but because of the way .NET does garbage collection, setting the reference to Nothing doesn't actually free the resources until the garbage collector comes through to clean up, which could potentially be a long time. That's why we have the IDisposable interface. Just setting the reference to Nothing isn't enough. As an example:
Dim b As Bitmap = New Bitmap("c:\test.png")
b = Nothing
System.IO.File.Delete("c:\test.png")throws an exception (IOException) because the Bitmap object still holds the file open and will continue to until the next GC. To clean up straightaway, you need to call Dispose().
Dim b As Bitmap = New Bitmap("c:\test.png")
b.Dispose()
System.IO.File.Delete("c:\test.png")And that works just fine. When you write classes that contain IDisposable objects, it's considered good form to make sure that you class either disposes of those objects when it's done with them, or make your class implement IDisposable as well, and make its Dispose method call Dispose on all disposable objects that it contains.
P.S. If you're interested, my sketchy web interface is an ActiveX control, available to play with at http://pirate.princeton.edu/DrawOnSign.html[^]
You can view the results on a web cam if you follow the link on the page.
|
|
|
|

|
Pete Everett wrote:
When you write classes that contain IDisposable objects, it's considered good form to make sure that you class either disposes of those objects when it's done with them, or make your class implement IDisposable as well, and make its Dispose method call Dispose on all disposable objects that it contains.
Well, this is an optimization, not a requirement. The bitmap will always get released, but you want it released RIGHT THIS VERY SECOND because you're creating a file and then immediately deleting it.
At any rate, I agree, the bitmap should be explicitly passed in to the class to provide finer control-- and to let you use bitmap objects in memory rather than disk, which is important for web apps. That's the best solution.
I made this change on Friday, and now I regret not uploading the new version immediately-- my article got promoted this weekend to a "real" article which means I have to wait for article/code changes to wind their way through the formal update process.
|
|
|
|

|
It's really, REALLY ghetto-- but until I get the proper version of the code to you that lets you pass the bitmap as a param, this will work in the meantime:
Dim b As Bitmap = New Bitmap("c:\kitty.gif")
b = Nothing
System.GC.Collect()
System.IO.File.Delete("c:\kitty.gif")
|
|
|
|

|
This is not good programming. You should never explicitly call GC.Collect. In reference to the Dispose method, you should always call Dispose on an object that implements IDisposable. To better realize this you need to understand how garbage collection works. If you do not call Dispose, the object will live until its Finalize method is called. This is not guaranteed to be called on the next generation collection so therefore the object could be promoted to the next generation. You could wind up with an object living into the next two or more generations which is bad. Always, always, always call Dispose.
|
|
|
|

|
Pete-- I emailed you directly, but I'm not sure if you got it or not (at the whiteboyfunk domain?). At any rate, the article has been updated and the code sample now provides a way to directly pass a Bitmap object in to the picture methods!
|
|
|
|

|
Anyone got a spare one of these things lying around?
cheers,
Chris Maunder
|
|
|
|

|
Doubtful but one of my blog readers posted that he picked up a BetaBrite on eBay for ~$100, which is a great deal. And once you get the PC cable hooked up and communicating using the API, you really don't need the IR remote, either..
|
|
|
|
 |
|
|
General News Suggestion Question Bug Answer Joke Rant Admin
|
A simple API for controlling a BetaBrite LED sign via RS-232 serial commands.
| Type | Article |
| Licence | |
| First Posted | 20 Mar 2005 |
| Views | 123,436 |
| Bookmarked | 54 times |
|
|