EV3 + LeJOS + Kotlin + intellij: seeking collaboration

This is where you talk about the EV3 software itself, installation issues, and programming talk.

Moderators: roger, gloomyandy, skoehler

salamanders
New User
Posts: 6
Joined: Sun Jul 16, 2017 5:10 pm

EV3 + LeJOS + Kotlin + intellij: seeking collaboration

Postby salamanders » Sun Mar 04, 2018 9:25 pm

[Kotlin](https://medium.com/@octskyward/why-kotl ... 5c001e26e3) is IMHO a great programming language for education. I got it working on my EV3, with a development loop that is **almost** self-sufficient: IntelliJ coding, gradle build and deploy to the brick over WiFi, but then I have to run the app and see the console output using the Eclipse [EV3Control](https://lejosnews.wordpress.com/2014/04 ... otors-tab/)

I'm looking for help to make it completely self-sufficient so I don't have to hop between IDEs. I think it would require remotely running the app and capturing the console from a deploy script?


Project at https://github.com/salamanders/waller

For example, here is a line-following app:

fun main(args: Array<String>) {
println("Follow that line!")

RobotWheels().use { wheels ->
EV3ColorSensor(SensorPort.S3).use { lightSensor ->
lightSensor.setFloodlight(true)
val redSensorMode = lightSensor.redMode
val lightSample = FloatArray(redSensorMode.sampleSize())

var numSamples = 0
buildSequenceTime(msFromNow = 10_000).forEach {
redSensorMode.fetchSample(lightSample, 0)
// println("Light: ${lightSample[0]}")
numSamples++
if (lightSample[0] < .5) {
wheels.left = 1.0
wheels.right = 0.1
} else {
wheels.left = 0.1
wheels.right = 1.0
}
Delay.msDelay(25)
}
println("Done sensing, $numSamples")
wheels.flt()
}
}
println("Bye bye.")
}

User avatar
esmetaman
Advanced Member
Posts: 377
Joined: Wed Sep 13, 2006 12:16 am
Location: UK, Milton Keynes
Contact:

Re: EV3 + LeJOS + Kotlin + intellij: seeking collaboration

Postby esmetaman » Tue Mar 27, 2018 6:29 pm

If you like, you can build your examples on Java 9 and soon in Java 10 for EV3 Brick & Brick Pi 3 using the LeJOS port on EV3Dev:
https://github.com/ev3dev-lang-java/ev3dev-lang-java

Last week, we started the migration to Debian Stretch. Latest stable version is v0.7.0 for Debian Jessie.

Cheers

Juan Antonio
Juan Antonio Breña Moral
http://www.juanantonio.info/lejos-ebook/
http://ev3dev-lang-java.github.io/#/
https://github.com/jabrena/livingrobots


Return to “EV3 Software”

Who is online

Users browsing this forum: No registered users and 1 guest