JAVA CODE

LK/ELK/VK/PK/OK/MX/GLK/EGLK/GVK/GLT Series

Moderators: Henry, Mods

Post Reply
modded_mike
LCD?
Posts: 6
Joined: Mon Mar 25, 2002 4:00 pm

Post by modded_mike »

I know that there are a few java examples to write to the LCD has anyone implimented this code onto a web interface to possibly display site context on the LCD? or display a current song playing on a webradio, or even a java stock ticker all via web

Henry
OMNIPRESENT
OMNIPRESENT
Posts: 3014
Joined: Tue Aug 14, 2001 6:00 pm
Contact:

Post by Henry »

Not that I know of... would be interesting though.
Henry J.
President
Matrix Orbital

PatO
LCD Geek
Posts: 27
Joined: Fri Sep 14, 2001 6:00 pm
Contact:

Post by PatO »

Go to http://java.sun.com and do a search for "serial port".
javax.comm.SerialPort is the package.
Looks fairly straightforward. Let us know how it goes!
http://www.planet-source-code.com is my favorite for code samples, but it seems fairly sparse in the java section...

<font size=-1>[ This Message was edited by: PatO on 2002-04-22 20:41 ]</font>

steven_mu
LCD?
Posts: 2
Joined: Mon May 06, 2002 6:00 pm

Post by steven_mu »

If you mean to use Javascript or a Java applet, you'll probably have serious trouble with permissions for writing to the serial port. I know the earlier versions wouldn't even let you read/write files on the host machine altough I think this was changed. Anyone trying to use the site would probably have to change their browser security settings. Would be cool if it works tho.

Thlayli
LCD Geek
Posts: 34
Joined: Sun Jan 20, 2002 4:00 pm
Location: Madison, WI
Contact:

Post by Thlayli »

This would actually be pretty easy in java, the source for a simple implementation of a java interface for the lcd is on MO's site. As for any implementation of, say, your stock ticker, the easiest thing to do would be to get out the good old java.net.* API and do your connection manually, and parse out relavant information. Kinda like emulating a browser from within your program. This would be an entirely client side application so it wouldn't have any issues with rights or anything. Looking at your ideas, a modification of this example should work for them. (Just for reference this type of program is usually called an 'agent') A great book to try for learning about this type of programming would be "Programming Bots, Spiders, and Intelligent Agents in Visual C++", wrong language, but the ideas in it transfer quite easily to java. Your post did mention a web interface, I'm not sure if you meant like my suggestion, program to web, or if you meant controlling the lcd from the web. If it was the latter, I gotta agree with steven_mu's post, writing to a serial port from an applet is right out. It's not even possible to enable it as far as I remember. But I have a bad memory. And I'm hungry.

Post Reply