lejos ev3 and scratch 2.0

Post your EV3 projects, project ideas, etc here!

Moderators: roger, gloomyandy, skoehler

lejos ev3 and scratch 2.0

Postby botkop » Fri Apr 11, 2014 9:08 pm

Hi,

I started working on a way to program the EV3 with the Scratch programming language (http://scratch.mit.edu/)

Source and documentation can be found on github:
https://github.com/koen-dejonghe/ev3-scratch-helper-app

Currently it's only possible to read a couple of sensors, but I think it's a good start.

Suggestions, bug reports, etc... welcome.
Thank you.
botkop
New User
 
Posts: 3
Joined: Fri Apr 11, 2014 9:00 pm

Re: lejos ev3 and scratch 2.0

Postby Iburong » Fri Apr 18, 2014 9:03 pm

Hi,

Today I got some free time to check your project, it works very good :D

I´m very interested in making Scratch work with my EV3 kit for my little daugther, and I´m happy to learn that there´s someone working on this for the EV3, now that it seems Enchanting is not going to be redone for the EV3.

Actually I´m too busy to be of any help, but maybe in some time I could help you a little with this. I develop Java enterprise applications for a living, but I´ve little idea of LeJOS and Scratch for the time present, it´s going to take me some time learning the tricks.

Are you aware of the ScratchJr initiative? Finally they got funds to make an simplified Scratch version for very little children, Android and Ipad versions.

My project for my little girl is to make something like project Primo with Lego EV3 for the robot and an Android tablet for the programing interface board. It could be done with Scratch with touch screen support (something ScracthJr is going to get), in this case I could use it for more serious teaching later. I don´t know if ScratchJr is going to support custom blocks the way you are using them for your project, we´ll know when they release it later this year.

Another option is to make it a web application, but I prefer the Scratch aproach if possible, it´s going to take a very long time for the kiddo to grow up and learn enough to make her own web applications in Java...

I´ll be tracking your work when possible, it´s a great project!!! :D

I´m also very interested in your gradle-maven-spring solution for the project, I´ll study it when I get some more time.

Thank you very much :)
Iburong
New User
 
Posts: 8
Joined: Fri Apr 18, 2014 8:38 pm

Re: lejos ev3 and scratch 2.0

Postby botkop » Sun Apr 20, 2014 10:16 pm

Thank you. It's always good to hear someone is interested.
I'm developing this for my kids too, well that's my excuse anyway.

Check out the project on github regularly. The last couple of days I've made some significant changes that greatly facilitate the creation of Scratch scripts.
I've also included a tiny demo program, and I'm working on something bigger.

On the whole I think it's getting more mature.
I'm hoping to get something non-trivial ready for the next coder dojo (http://coderdojo.com) here in Belgium, and show it to the kids.
botkop
New User
 
Posts: 3
Joined: Fri Apr 11, 2014 9:00 pm

Re: lejos ev3 and scratch 2.0

Postby Iburong » Sun Apr 27, 2014 4:54 pm

Hello,

I tried your latest code two days ago, and I must say I´m pretty impressed with it. Good work!

I got no chance to try the motors, I need some time to build a test robot, but I tested some sensors. The Infrared one worked with my Ultrasonic sensor in some way, I got readings, but they were not correct or consistent. The touch and color ones did work. But I got a lot of errors on the console, and sometimes the scratch editor would not respond to any command. I think it must be polling to get the sensors readings but gets a nullpointer somewhere.

I´d like to test it properly and give you some logging of the errors, but currently I´ve little time for it. If I get a chance next week, I´ll try.

I also tried to change the pom to the 0.8.1 version, I´ve put the official jar in my local maven repository, and I think you can safely change to that version, I saw no differences between them in the execution of the project.

I like the new gradle configuration, it´s easier to use, but I don´t understand it fully yet, the same with the spring part. I use spring at work, but in multilayer web applications, mainly with JSF, I´ll try to get some time for studing your code :D

Good luck with the coderdojo event, I think this kind of project can be something very interesting for young kids :D
Iburong
New User
 
Posts: 8
Joined: Fri Apr 18, 2014 8:38 pm

Re: lejos ev3 and scratch 2.0

Postby botkop » Mon Apr 28, 2014 4:50 am

Thanks for trying.

I have not implemented the ultrasonic sensor (yet), because I do not own one. Perhaps in a later stage I will buy one and add it.

Connecting sensors and motors is still a problem. There are 3 players: scratch, the helper app, and lejos. I have not found a satisfactory way yet to sync them. So, for now, you must be very careful when to do things.
The best approach is like this: boot the ev3, start the helper app, start scratch, import the experimental extension of the helper app.
On the ev3, connect the motors and sensors you want to use. In scratch, connect the motors and sensors to the correct ports, and check the log of the helper app to see that everything is connected and ready.
From here on you should be able to read the motor/sensor variables, and to control the motors.

However, if you stop the helper app without disconnecting in scratch (using the Reset block - not an appropriate name, I will change it), then lejos still assumes the sensors/motors are connected. When you restart the helper app, it is not aware of the current connections and until now I have not found a way to have lejos report the actual status of the connections through RMI. If anyone knows how to do this, I'd be happy to implement it.

Hopefully this explains the errors you got a bit, and also how to get around them.
botkop
New User
 
Posts: 3
Joined: Fri Apr 11, 2014 9:00 pm


Return to EV3 Projects

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff