1

I have just written a java algorithm to get a chess move when a chess move is inputted in SAN notation the algorithm used : Monte Carlo. Is it possible to integrate this program with an Arduino mega and How?

My mega will be getting inputs from a sensory board and I want to send these inputs to the java program without using any additional board.

Note:
By integrate I mean that the Java program should run in the Arduino mega itself

Can anyone suggest a solution?

  • 2
    Do you want to run the Java program inside the Arduino, or do you want to use the Arduino as an IO device for a PC running the Java program? – Edgar Bonet Jul 7 '18 at 13:30
  • @EdgarBonet I want to run the java program inside the Arduino. – Roshan Jul 7 '18 at 17:28
  • Now click on the “edit” link just below your post and revise your question to make that clear. The question should be self contained, one should not have to read through the comments to understand it. – Edgar Bonet Jul 7 '18 at 19:32
1

There is a project called uJ by Dmitry Grinberg that enables you to do that, somehow. It has been tested on AVR devices too, not your particular one however. Knowing AVRs, that shouldn't be a stopper at all.

That said, I don't think it's a very good idea. The overhead of the JVM may only let you handle some 'slow' signals, unless you heavily rely on peripherals and wit to do stuff. Though in your particular application, that shouldn't be that much of an issue.

Instead of having the trouble of running a JVM and such, you may just as well rewrite the code in C/C++ or whatever, even for increased efficiency. There may also be some Java to C transpilers, I haven't looked, wary of the dragons.

However, if you eventually decide against that and instead choose to talk to the microcontroller over serial or something else, there is the dreadful excellent RxTx library for Java that works pretty fine after all, or the Firmata library.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.