Hi everyone,
I’ve been playing around with my Arduino UNO for a while now, and have also been looking for a way to program it in Java (since I’m a Java programmer trying to get into electronics and robotics). I found out about the rxtx library, so that question is pretty much solved for me. However, it felt like using rxtx is a rather “improvised” way to control an Arduino, as the most recent x64 dll-files date back to 2008, leading to mismatches with the current rxtx library etc. Overall, it just didn’t look like the way the Arduino is really meant to be used. So I’ve done some further research and here’s my conclusion so far:
The Arduino is programmed in Arduino language, which is based on C/C++. So, you don’t program an Arduino in Java. You program it by writing that so called “sketch”, a code that’s basically C/C++, in the IDE on your PC, then upload it to your board, where it will run. Everything you do with Java is just interfacing between the Arduino and your PC.
So, my assumption is that in real-life robotics, you program your Arduino (if you choose this as your microprocessor) with an Arduino sketch. Inputs are taken through the reading pins or by somehow hooking it up to an R/C (right…?). If you still need to connect it to your PC (for example because the main part of your system is the software, rather than the robot) you have to find a way to let your board and PC interface. For Java, rxtx is that interface, but they also exist for many other languages and software.
Now, my question is actually twofold: first of all, what do you think about my conclusion? Is it more or less accurate or did I understand this all wrong?
Secondly, just out of curiosity: how do developers go about creating such an interface? You have an Arduino, a USB cable, and a PC, now what do you do? What type of code do you need to write (C, Assembly, …), what files do you have to build (dll, …), …? I assume you have to get a lot of specifications from the manufacturer as well, about how signals are being read, interpreted, sent, etc., right? Not that I have any intention of building such an interface on my own, it just annoys me when I use something and have no idea how and why it works
Best,
Silas