So I have been looking into ways to replicate this video A Robot That Shocks You If You Lose Hearts in Minecraft - YouTube
I made the plugin Im just having a hard time trying to control the arduino with a java IDE. I have the exact same arduino as him so I know I should be able to do it. I have tried things like ardulink, jarduino, RXTX, but none of them look like what he used and the majority of any resources about them are like seven years old and difficult to use. does anybody recognize what he used to communicate to his arduino with java?
also I tried using jarduino but was having trouble getting it to work right, I dont care if its the exact same thing as the video I just was trying to copy it because I knew that worked for him. if there is something else that would work for this thats fine too
That's a 10 minute video about something (computer games) that I have zero interest in.
Can you describe the programming problem you are having?
Posting your code and telling us exactly what happens when you run it and what you want it to do that is different would be a good place to start.
...R
Im trying to simply just turn on a pin in a java IDE but im having trouble with it. It needs to be in java because thats what you have to program the plugins in. I tried jarduino but it was saying that it couldnt compile it for my uno
Please post your code.
I dont have any code I want to program an arduino in a java IDE and im trying to figure out how to do that.
rahvin:
Im trying to simply just turn on a pin in a java IDE but im having trouble with it.
Arduinos have pins. Java programs running on a PC don't have pins. What exactly do you mean?
I dont have any code I want to program an arduino in a java IDE and im trying to figure out how to do that.
I don't know what to make of that. In your Original Post you said "I have tried things like ardulink, jarduino, RXTX," How could you try them without having code?
Let's go back to basics. You have watched a video that has something in it that you want to create for yourself. What exactly do you want to create?
...R
by turning on A pin I meant on the arduino I just want to control a pin in a java IDE, I tried using jarduino which is an example you upload to your board so you can then connect it by usb to your serial port and remotely control it with java. When I tried uploading jarduino to my board it was saying it couldnt compile it for my arduino. the others also didnt appear to be what he used in the video and as I said most resources on it are from like 2013 and its annoying to find anything on how to do it.
It would be super helpful it you actually posted the error you get when you are trying to compile. I am assuming you are trying to compile the JArduino firmware to install on your board. I tried it and got an undefined variable in Jarduino.cpp. I had to change 'baud' to 9600 (or whatever you want)
// Public Methods //////////////////////////////////////////////////////////////
void JArduino::init_JArduino() {
// init the serial port
//Serial.begin(baud);
Serial.begin(9600);
}
You can also talk to an arduino using simple Serial communication.
rahvin:
by turning on A pin I meant on the arduino I just want to control a pin in a java IDE,
I think what you are trying to say is that you want your Java program to be able to send a message to your Arduino which causes the Arduino to turn an I/O pin HIGH or LOW.
If that is what you want to do then why not write a simple Java program to send a message to the Arduno over the serial connection (the regular Arduino USB cable) and write an Arduino program to receive the message and act on it.
I am not familiar with Java but for receiving data on the Arduino have a look at the examples in Serial Input Basics - simple reliable non-blocking ways to receive data. There is also a parse example to illustrate how to extract numbers from the received text.
The technique in the 3rd example will be the most reliable. It is what I use for Arduino to Arduino and Arduino to PC communication.
You can send data in a compatible format with code like this (or the equivalent in any other programming language - Java in your case)
Serial.print('<'); // start marker
Serial.print(value1);
Serial.print(','); // comma separator
Serial.print(value2);
Serial.println('>'); // end marker
...R