Can I develop Lego Mindstorms in Scala?
Asked Answered
I

3

10

Is there a Java SDK for Lego Mindstorms? Can I compile Scala code to JAR and run it in Lego Mindstorms?

Interference answered 1/10, 2011 at 12:11 Comment(0)
E
6

Likely no, but difficult to say. Mindstorm JVMs aren't complete JVMs, though they're not bad.

That said:

Even assuming all the classes you needed were available, Scala "lets" you use large quantities of memory before you realize what's happening. It's not certain–you can control what parts of Scala you use. Restricting yourself eliminates some of Scala's advantages, though.

My approach would be to run a server (or client) on the bot and use Scala on a real machine to control the bot over wireless. Obviously this has its own set of disadvantages.

Enfeeble answered 1/10, 2011 at 14:30 Comment(0)
S
4

Maybe it's not valid anymore, but you can develop in Scala for Mindstorms EV3, here is an example: https://github.com/t3hnar/ev3.helloworld

Soupy answered 22/4, 2014 at 20:16 Comment(0)
R
2

I'm not sure about Lego Mindstorms (never seen it), but generally, yes. You can compile your scala code to JAR, add scala-library.jar, and run it just like normal Java program.

If your program accepts only one jar, you can combine your JAR with scala-library.jar and create a single file.

Rolfston answered 1/10, 2011 at 13:25 Comment(1)
My intuition was the same, but as the LeJOS (Java for Lego Mindstorms) uses an own compiler called nxjc I am not so sure about this.Ribonuclease

© 2022 - 2024 — McMap. All rights reserved.