I am new to arduino and I want to interface it using java . I want to know is there a way to change the variable or set the variable using the input from java :D Thanks For reading Hope you can answer my question .. Sorry for my english not my first language :D
closed as too broad by sa_leinad, Mattia, jfpoilpret, Dat Ha, KIIV Oct 28 '16 at 19:44
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
Although you can't straight-up change variables on the Arduino, you can create your own protocol over a serial connection using processing (https://processing.org) on your computer, and a sketch on Arduino.
Use the function
on the arduino to initialise a serial connection to your computer, and then in processing use the lines:
Serial myPort; // Initialise a serial object (do this at the start of the program) // Inside the setup() function: String portName = Serial.list(); // Get the first portname on the list (this may need to be changed to get the right one) myPort = new Serial(this, portName, 9600);
to connect from the computer.
Once you have done this, you can use the functions
in processing, and
val = Serial.read();
To recieve data on the arduino.
Source (see here for more info): https://learn.sparkfun.com/tutorials/connecting-arduino-to-processing/all