Results 1 to 4 of 4
  1. #1
    asifzbaig is offline Member
    Join Date
    May 2011
    Posts
    56
    Rep Power
    0

    Default 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?

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,188
    Rep Power
    19

    Default Re: Working with external hardware components in java?

    Thread moved. Haven't-a-clue questions and homework don't belong in Advanced Java.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    ozzyman's Avatar
    ozzyman is offline Senior Member
    Join Date
    Mar 2011
    Location
    London, UK
    Posts
    797
    Blog Entries
    2
    Rep Power
    4

    Default 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

  4. #4
    Sierra is offline AN21XX
    Join Date
    Mar 2012
    Location
    Munich
    Posts
    297
    Rep Power
    3

    Default 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

  1. How do I create chips and hardware coded on java?
    By Addez in forum Advanced Java
    Replies: 15
    Last Post: 09-07-2010, 02:33 PM
  2. Replies: 4
    Last Post: 03-26-2010, 08:16 AM
  3. Swing components not working
    By primalpop in forum AWT / Swing
    Replies: 30
    Last Post: 11-15-2009, 05:10 PM
  4. Replies: 8
    Last Post: 05-28-2008, 07:00 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •