Results 1 to 4 of 4
- 03-17-2012, 11:05 AM #1
Member
- Join Date
- May 2011
- Posts
- 56
- Rep Power
- 0
Working with external hardware components in java?
I am talking about components that can be externally attached to a computer system via some port or other means, not about any of the component that is part of or peripheral of computer itself.
Actually, working on a college project for controlling traffic lights and boom barrier at railway crossing. I've got knowledge in Java but I do not know how can I get the traffic lights and boom barrier working on events in a Swing based application?
One thing is I can create a electronic circuit which can read the small output voltages at computer ports such as a USB port and used them as a trigger for controlling the devices. But how can I generate that small voltages using Java application?
Is JavaPOS can be the solution? or something else?
Any ideas? Suggestions? Articles? Samples?
- 03-17-2012, 02:00 PM #2
Re: Working with external hardware components in java?
Thread moved. Haven't-a-clue questions and homework don't belong in Advanced Java.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
-
Re: Working with external hardware components in java?
JavaPOS is for POS (point of sale) devices such as Receipt Printers, Ticket Printers, Cash Drawers, Barcode Scanners, etc. If you're using any of those devices, you should use JavaPOS.
Since you're not using any POS hardware you probably want to connect your device to a computer via USB, in which case you might be interested in jUSB:
an open source API for USB, supporting applications using Java host-side software to drive USB devices. This is for Linux hosts only.
Links:
Access USB devices from Java applications
Java USB: Overview
There is also JCommUSB which is not free but supports all Windows OS, it is for USB and RS232.
Java IO Solutions Serial RS232 & USB
- 04-11-2012, 11:24 AM #4
AN21XX
- Join Date
- Mar 2012
- Location
- Munich
- Posts
- 297
- Rep Power
- 2
Re: Working with external hardware components in java?
To control hardware you need to make up your mind on the following points:
1- which microcontroller to use for the controlling of the hardware (traffic lights need a hardware logic to work and be controlled)
2- which interface to your computer is available (USB, RS-232, etc.)
3- for this you need driver support on your chosen operating system (mind 32 and 64-Bit!) from the controller manufacturer (*.sys and *.inf files)
4- for the driver you need a library (*.so for linux or *.dll for windows) to access it from any programming language
5- to use this in Java you need a wrapper to access the functionality in the platform independant design (this either is available or you have to write it)
Usually Step 4 and 5 are the problems though step 4 is only in special cases a problem (old systems, etc.)
For step 5 I recommend JNA which is a very easy way to create good wrappers for your DLL.
Similar Threads
-
How do I create chips and hardware coded on java?
By Addez in forum Advanced JavaReplies: 15Last Post: 09-07-2010, 02:33 PM -
running external program in directory different from working dir
By nickvandewiele in forum New To JavaReplies: 4Last Post: 03-26-2010, 08:16 AM -
Swing components not working
By primalpop in forum AWT / SwingReplies: 30Last Post: 11-15-2009, 05:10 PM -
Java mail problem(working in intranet,but not working in iternet)
By sundarjothi in forum Advanced JavaReplies: 8Last Post: 05-28-2008, 07:00 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks