The Source for Java Technology Collaboration
User: Password:



Joshua Marinacci

Joshua Marinacci's Blog

Free Projects Part 4: an LCD Controller

Posted by joshy on January 19, 2007 at 02:34 PM | Comments (8)

My sincere apologies. I completely forgot to post the code from the last free project, sketch pad, so here it is. I also forgot that I have one more project to give away, one very different than anything else I've ever done. This one involves some hardware.

Another crazy idea

You see, every so often I get a crazy idea for a startup, put some effort into it, and then realize that I know nothing about hardware or how to start a company. That means my harddrive is filled with interesting and bizarre company ideas, some of which are more developed than others. This is one of the more developed ones.

My idea was that when you play a full screen game or are doing something else which takes you full attention it would be nice to have a little LCD screen which would sit next to your computer and show you ambient information such as the time, weather, or the currently playing song on your MP3 player. If the gadget had buttons then you could use it to switch tracks, change the volume, look at different weather settings, or anything else you wanted to with it. Showing instant message alerts, for example.

There would be software on your computer which controlled this little gadget and had a set of plugins for doing different things. Since this would be written in Java you could easily write your own plugins to look at cool webservices or hook into native applications and system resources. The possibilities are endless!

Of course the possibilities are always endless, and I spent endless amounts of time playing around with it before I went on to other things. Maybe it's still a good idea. After all, this gadget seems to be selling, and mine would have been better. It's blue! Anyway, there is still a lot of interesting code hiding in here so it might still be useful to some of you.

The LCD controller

First of all, I purchased and wrote a little Java device driver for the Crystal Fontz 631 LCD display (the 601 as well, I think). It is a two line LCD display with four buttons and a USB connection. Given the poor state of USB in Java I had to install a USB to Serial device drive on my computer and then connect to the LCD as if it was a real serial port with the RXTX serial library.

Once I had access to the serial port I wrote some Java code to implement the LCD's packet protocol. This drove me crazy for days because I could get the word NOON to show up just fine but the word MOON would not. I finally figured out that the C code I was working from was written for Linux and assumed a little endian processor. Since Java is big-endian (which, like gravity, is the right way), my code only worked when the text happened to be symmetric! *sigh*. Bugs like these were the reason I stopped writing C code a decade ago.

Here is what the desktop control app looked like:

net.joshy.lcdbrick.LCDControllerScreenSnapz003.png
The clock plugin

As you can see, it has a simulation of the real LCD panel which shows you what the plugin or animation will look like when it running. You can configure each plugin and set which ones the panel will cycle through. The LCD lets you define custom glyphs, which is how I created the fake large font for the time numbers.


weather plugin

The app also had a really bad glyph editor which you can see here:


glyph editor

But it did let you do some funky animations like this:


funky animation in progress

The code you are probably interested if you want to hack on this particular LCD panel is the CF601LCDPanel and Packet classes in the net.joshy.lcdbrick.serial package. There is interesting code in the plugins packages for reading weather, getting the current DHS threat level, and checking for new email. There is also some Mac specific code for controlling iTunes, getting the current battery level, setting the system volume.

So if you want it, let me know.

NetBeans Action Property Editor update

And to tide you over until we have something more to show, here is the latest screenshot of the Action Property Editor for JSR 296. It's a bit cleaner than the previous one and now you can edit icons! Let me know what you think.

Update: code download

The code is available here


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • Nice, but been there and done that:
    http://www.crystalfontz.com/forum/attachment.php?attachmentid=60&d=1038515723

    Posted by: mrmorris on January 21, 2007 at 05:44 AM

  • Many people have, of course, done it before. It's a rather obvious idea. That didn't make it be any less fun and interesting. In any case, if anyone else wants to do it themselves I thought the serial IO code might be useful. No sense reinventing that part.

    Posted by: joshy on January 21, 2007 at 08:56 AM

  • The
    Logitech G15 has also a programmable LCD.
    I think there are also some Java API for it around.

    Posted by: weertj on January 22, 2007 at 06:35 AM

  • Very cool Josh! Yea, I wish Java could get a good USB imp, but I guess thats a dream. :( As a note, looking good on the editor stuff, some day I should post a list of concerns about netbeans stuff that just drives me up the wall. Perhaps you might know if there are purposed fixes coming in NB6, or if its just a thats how it is type thing.

    Posted by: olsonje on January 22, 2007 at 06:44 AM

  • Josh, I don't see the link for the source for this LCD Controller Netbeans project. Did I miss it or are you planning to post it? Thanks!

    Posted by: pdev on April 02, 2007 at 08:45 AM

  • Hmm. I could have sworn I had posted it. In any case, here it is:

    http://files.joshy.org/files/joshy/blog/freecode/lcdcontroller/LCDBrick.zip

    Posted by: joshy on April 11, 2007 at 08:39 AM

  • Josh, have you ever thought about how to recieve key pad touchs from a telephone in Java? I am needing a simple unobstrusive input device for a church nursery.

    Posted by: saipanman95 on October 29, 2007 at 09:19 AM

  • I'm afraid I've never done that. I hear there are some Java telephony apis though. Probably best to start with a Google search.

    Posted by: joshy on October 30, 2007 at 03:39 PM



Only logged in users may post comments. Login Here.


Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds