Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8766995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:41:36+00:00 2026-06-13T16:41:36+00:00

Mission: Display data in a program on a PC. Extended mission: (after solving this

  • 0

Mission: Display data in a program on a PC.

Extended mission: (after solving this problem) I will eventually save the data to files and expand the program into a GUI.

Microcontroller: Arduino duemilanove

OS: Windows 7

Language: Java

Compiler: Eclipse

Io method: USB type ‘B’ (arduino side), USB type A (PC side)

I’ve read at least 30 different tutorials/questions here and on other websites. I’ve grabbed examples from sites and downloaded a few libraries and keep getting red lines and errors. I’ve now scrapped it all and decided to humbly come here and see if anyone is willing to help me out.

I suspect I’m in over my head but that’s fine, I’m happy to learn, and be called stupid!

I understand other software, such as ‘processing’ is already available that could do this for me. I want to make this software myself.

I’ve looked at RXTX and COMM API. To be honest, all I’ve gotten out of it so far is that I know it exists, some stuff is outdated apparently, and it seems most tutorials assume a large amount of knowledge in various subjects.

I also looked at more questions asked here as I write this question, and most of them I have already seen before. I’m waving the white flag! someone help me learn what I’m doing!

Code example of what I want to do.

// How would I make this class read from the arduino?

class arduinoData {

    static int t = (int) 72.91; //pull from arduino instead of making it up

    static int temperature(){

        return t;
    }


}


public class example
{
    public static void main(String[] args) 
    {
        System.out.println("temp from the sensor is: "+   arduinoData.temperature()+"F");
    //output:
    //temp from the sensor is: 71F
    }
}

Edit: Arduino serial monitor works correctly. I’ll add the arduino code to clear that up.

#include <OneWire.h>
#include <DallasTemperature.h>

#define ONE_WIRE_BUS 3
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);


DeviceAddress Thermometer = { 0x28, 0x56, 0xA0, 0xA5, 0x03, 0x00, 0x00, 0x7D };

void setup(void)
{
  Serial.begin(9600);
  sensors.begin();
  sensors.setResolution(Thermometer, 10);

  pinMode(13, OUTPUT);  

}


    void printTemperature(DeviceAddress deviceAddress)
    {
      float tempC = sensors.getTempC(deviceAddress);
      if (tempC == -127.00) { Serial.print("Error."); }
      else {Serial.print(DallasTemperature::toFahrenheit(tempC));Serial.print("F");}
    }


void loop(void)
{ 
   digitalWrite(13, HIGH);
   delay(1000);
   digitalWrite(13,  LOW);
   sensors.requestTemperatures();
   Serial.print("temp from sensor: ");printTemperature(Thermometer);
   Serial.print("\n\r");
}

Arduino output:

Temp from sensor: 70.25F

Temp from sensor: 70.70F

Temp from sensor: 70.70F

Temp from sensor: 70.70F

update:

Ok I think I have rxtx installed correctly via the tutorial mentioned below. However, I’m lost at this point:

For Windows you can create a batch file called run.bat in the same
directory as the sample code mentioned above. This batch file can be
used on your system, but you may need to modify the paths to match the
install locations of your Java and Arduino IDE on your system.

setlocal set PATH=%PATH%;C:\Program Files (x86)\arduino-0017\
“C:\Program Files (x86)\Java\jdk1.6.0_12\bin\javac” -cp “C:\Program
Files (x86)\arduino-0017\lib\RXTXcomm.jar” SerialTest.java “C:\Program
Files (x86)\Java\jdk1.6.0_12\bin\java” -cp “C:\Program Files
(x86)\arduino-0017\lib\RXTXcomm.jar;.” SerialTest

Basically, you will need to add the RXTXcomm.jar to your class path,
and you will need to add the associated JNI interface DLL
(rxtxSerial.dll) to your PATH. For other platforms, you will need to
add the same JNI shared library to your run time path.

When you run the run.bat file, you should see the same results as the
Arduino IDE Serial Monitor. You can use Ctrl+Break to stop the
program.

What am I supposed to be doing???

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T16:41:38+00:00Added an answer on June 13, 2026 at 4:41 pm

    Check if your firmware is actually making Arduino print to the usb, that is virtualized as serial port: load the firmware and test the serial communication via the “Serial monitor” (the lens button on the right).

    Once done, you know your problem is related to the java code that attemps to read from the COM interface. If you still have issues here, your problem has moved to “reading from the serial port with Java”.

    For a general reference about interfacing Arduino with Java I suggest you to read this tutorial with explanations and code samples: http://www.arduino.cc/playground/Interfacing/Java

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working on a pet project concerning efficiency and data and this is the mission
Each time my program loops the data which is stored inside an int array[]
I have next mission: i have to replace flash alement with javascript in this
So my new mission (lol). I'm looking to create a script that will rotate
I am considering creating a MySQL Data Base for a non-mission critical project. I
This is a very basic question. I'm just on my mission to learn ASP.NET
In my router.php file I added this code. $route['mission'] = content/index/mission; Here as you
Currently, I have 20+ URLs on my site in this format http://www.example.net/content/index/mission I want
I have a long string from android Http get like this: {movies:[ {movieId:fmen71229238,eTitle:Mission: Impossible
My boss gave me the big mission to become an Core Data nerd. He

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.