0

I am trying to use Java to detect signals from the serial port sent from an IR circuit. When the IR circuit detects an obstacle, it gives an output of 0 volts and otherwise the output is 5 volts. Can I read these voltage differences directly on the PC using Java. Do I need to have a PIC or some other micro controller integrated in the circuit?

3
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by shawnv100
0

I think you will need some kind of driver that will connect to java to get data from a serial port.

0

A steady 5v or 0v signal is not a standard RS-232 signal. First, you need a specialized driver capable of detecting that the voltage change is valid and not just a transient glitch (not uncommon), and then passing the appropriate information to the user-space application (java in this case). Honestly, this would be a lot easier in C, and may be simpler to create a JNI to the C code that will let your java application to detect these state changes. Have fun, and good luck!

0

yeah...i installed the driver....i had tested this with a hyper terminal and i did get readings...so shouldn't java be able to detect it as well...

0

yeah...i installed the driver....i had tested this with a hyper terminal and i did get readings...so shouldn't java be able to detect it as well...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.