Java Application with Arduino

Guys, I'm new to arduino and I made some basic sketches that I learned from tutorials and stuff. One of them is that an led is turned on when the letter f is pressed and switched off when it is pressed again. I wanted to make an application with gui so that there will be two buttons on and off to turn on and off the led with arduino. The problem is that I don't know how to combine the java application with the arduino sketch. Thanks in advance for your help :slight_smile: :slight_smile:

The problem is that I don't know how to combine the java application with the arduino sketch.

You don't. The java application needs to talk to the serial port that the Arduino listens to. There are examples on the Playground, under interfacing with software, for many languages in addition to Java.

Thank You for your reply

You might want to try this open source GUI
http://forum.arduino.cc/index.php?topic=182442
https://github.com/selfonlypath/Arduino-ElectroShaman

The true power of this GUI:

  • there is a part which runs on Windows or Mac - this part is called the GUI
  • there is part which runs on the Arduino (Mega, DUE, ...) - and is part of the sketch
  • between the GUI and the sketch, there is USB communication (the standard one used by Arduino), and a proper protocol for exchanging data

In the Arduino sketch, you define what parameters you would like to use in teh GUI:

  • there are 12 sliders on which you can set the min, max and default values
  • in addition there are 8 checkbox controls
  • lastly there is a console text section
    Once you start your GUI, you get a default screen.
    Upon establishing the connection the Arduino (is just selecting the right serial port), the setup parameters are exchanged.
    From then onwards, you can adjust all your desired Arduino parameters LIVE from your GUI!

As an example, you can life-update the PWM frequency, or duty-cycle of any timer (you just program in the sketch what you want to get).
Same with the 8 checkbox. This acts like an on/off switch, where you can command just anything to your Arduino.
The console section, is to receive text messages from your Arduino, as you have programmed it in your sketch.
Suppose you have a system programmed with a PLL, you could send a message to the GUI telling the "PLL is locked".
Use your imagination!!

It's a very flexible thing, instead of juggling around with adjusting the parameters in your sketch, reprogram and reload, you just do it live from the GUI.

Albert

Thank You very much I will try this out